lib/rspec/rails/api/dsl/example_group.rb in rspec-rails-api-0.5.0 vs lib/rspec/rails/api/dsl/example_group.rb in rspec-rails-api-0.6.0
- old
+ new
@@ -26,11 +26,11 @@
# @param type [Symbol] Name of the entity for reference
# @param fields [Hash] Fields declarations
#
# @return [void]
def entity(type, fields)
- metadata[:rra].add_entity type, fields
+ RSpec::Rails::Api::Metadata.add_entity type, fields
end
##
# Describes request or path parameters
#
@@ -74,9 +74,19 @@
end
attributes ||= metadata[:rra].parameters[defined]
metadata[:rra].add_request_params attributes
+ end
+
+ ##
+ # Declares security schemes valid for this path. It won't be enforced during testing but will complete the
+ # documentation. When the reference does not exist, an exception will be thrown _during_ render, not before.
+ #
+ # @param scheme_references [Array<Symbol>] References to a security scheme defined with the renderer's
+ # `add_security_scheme`.
+ def requires_security(*scheme_references)
+ metadata[:rra].add_security_references(*scheme_references)
end
##
# Defines a GET action
#