Class: RspecRequestHelpers::Configuration
- Inherits:
-
Object
- Object
- RspecRequestHelpers::Configuration
- Defined in:
- lib/rspec_request_helpers/configuration.rb
Instance Attribute Summary collapse
-
#content_types ⇒ Object
Returns the value of attribute content_types.
-
#status_codes ⇒ Object
Returns the value of attribute status_codes.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #symbols_with_status_codes ⇒ Object
Constructor Details
#initialize ⇒ Configuration
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_types ⇒ Object
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_codes ⇒ Object
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_codes ⇒ Object
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 |