Class: RspecRequestHelpers::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec_request_helpers/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



11
12
13
14
# File 'lib/rspec_request_helpers/configuration.rb', line 11

def initialize
  @content_types = { json: 'application/json' }
  @status_codes  = [404, 401, 422, 200, 201]
end

Instance Attribute Details

#content_typesObject

Returns the value of attribute content_types.



9
10
11
# File 'lib/rspec_request_helpers/configuration.rb', line 9

def content_types
  @content_types
end

#status_codesObject

Returns the value of attribute status_codes.



9
10
11
# File 'lib/rspec_request_helpers/configuration.rb', line 9

def status_codes
  @status_codes
end

Instance Method Details

#symbols_with_status_codesObject



16
17
18
19
20
21
# File 'lib/rspec_request_helpers/configuration.rb', line 16

def symbols_with_status_codes
  status_codes.inject({}) do |hash, code|
    hash[STATUS_CODE_TO_SYMBOL[code]] = code
    hash
  end
end