Module: TestAssistant::Json::Helpers

Defined in:
lib/test_assistant/json/helpers.rb

Instance Method Summary collapse

Instance Method Details

#eql_json(expected) ⇒ Object



13
14
15
# File 'lib/test_assistant/json/helpers.rb', line 13

def eql_json(expected)
  TestAssistant::Json::Expectation.new(expected)
end

#json_responseObject



5
6
7
8
9
10
11
# File 'lib/test_assistant/json/helpers.rb', line 5

def json_response
  begin
    JSON.parse(response.body)
  rescue JSON::ParserError
    '< INVALID JSON RESPONSE >'.freeze
  end
end