Module: Contracto::RSpec::JsonHelper
- Defined in:
- lib/contracto/rspec/json_helper.rb
Defined Under Namespace
Classes: ContractRequest, Response
Instance Method Summary
collapse
Instance Method Details
#api_response ⇒ Object
13
14
15
|
# File 'lib/contracto/rspec/json_helper.rb', line 13
def api_response
Response.new(response.body, @contracto_rspec_options)
end
|
#compare_json_with_contract!(options = {}) ⇒ Object
5
6
7
8
9
10
11
|
# File 'lib/contracto/rspec/json_helper.rb', line 5
def compare_json_with_contract!(options = {})
@contracto_rspec_options = options
expected_json = contract_response.to_json
given_json = api_response.to_json
expect(given_json).to eq(expected_json)
end
|
#contract_response ⇒ Object