Module: RocketPants::TestHelper::ResponseHelper
- Defined in:
- lib/rocket_pants/test_helper.rb
Instance Method Summary collapse
Instance Method Details
#decoded_body ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/rocket_pants/test_helper.rb', line 29 def decoded_body @_decoded_body ||= begin decoded = parsed_body if decoded.is_a?(Hash) Hashie::Mash.new(decoded) else decoded end end end |
#parsed_body ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/rocket_pants/test_helper.rb', line 21 def parsed_body @_parsed_body ||= begin ActiveSupport::JSON.decode(body) rescue StandardError => e nil end end |
#recycle_cached_body! ⇒ Object
17 18 19 |
# File 'lib/rocket_pants/test_helper.rb', line 17 def recycle_cached_body! @_parsed_body = @_decoded_body = nil end |