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.
5 6 7 8 |
# File 'lib/rspec_request_helpers/configuration.rb', line 5 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.
3 4 5 |
# File 'lib/rspec_request_helpers/configuration.rb', line 3 def content_types @content_types end |
#status_codes ⇒ Object
Returns the value of attribute status_codes.
3 4 5 |
# File 'lib/rspec_request_helpers/configuration.rb', line 3 def status_codes @status_codes end |
Instance Method Details
#symbols_with_status_codes ⇒ Object
10 11 12 13 14 15 |
# File 'lib/rspec_request_helpers/configuration.rb', line 10 def symbols_with_status_codes status_codes.inject({}) do |hash, code| hash[STATUS_CODE_TO_SYMBOL[code]] = code hash end end |