module RSpec::Resources::DSL::Characteristics::ClassMethods
Public Instance Methods
it_has_restricted_access(for_resource: :restricted_resource, only: %i[index show create update destroy])
click to toggle source
# File lib/rspec/resources/dsl/characteristics.rb, line 31 def it_has_restricted_access(for_resource: :restricted_resource, only: %i[index show create update destroy]) metadata[:it_has_restricted_access] = { for_resource: for_resource, error_status: 404, only: only, } end
it_needs_authentication(with_headers: :auth_headers, only: %i[index show create update destroy])
click to toggle source
# File lib/rspec/resources/dsl/characteristics.rb, line 20 def it_needs_authentication(with_headers: :auth_headers, only: %i[index show create update destroy]) metadata[:it_needs_authentication] = { headers: with_headers, error_status: 401, only: only, } metadata[:request_headers] ||= [] metadata[:request_headers].push with_headers end
visible_attributes(*params)
click to toggle source
# File lib/rspec/resources/dsl/characteristics.rb, line 10 def visible_attributes(*params) params = params.first if params.length == 1 && params.first.is_a?(Array) let(:visible_attributes) { params } end