Skip to content

Commit

Permalink
fix: message pact verification code
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Mar 24, 2018
1 parent f079909 commit 1bfa8f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/pact/provider/rspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def describe_message expected_response, interaction_context
include Pact::RSpec::Matchers
extend Pact::Matchers::Messages

let(:expected_content) { expected_response.body[:content] }
let(:expected_content) { expected_response.body[:content].as_json }
let(:response) { interaction_context.last_response }
let(:differ) { Pact.configuration.body_differ_for_content_type diff_content_type }
let(:diff_formatter) { Pact.configuration.diff_formatter_for_content_type diff_content_type }
Expand All @@ -117,11 +117,11 @@ def describe_message expected_response, interaction_context
let(:response_body) { parse_body_from_response(response) }
let(:actual_content) { response_body['content'] }

it "has matching content" do
it "has matching content" do | example |
if response.status != 200
raise "An error was raised while verifying the message. The response body is: #{response.body}"
end
expect(actual_content).to match_term expected_content, diff_options
expect(actual_content).to match_term expected_content, diff_options, example
end
end

Expand Down

0 comments on commit 1bfa8f3

Please sign in to comment.