Skip to content

Commit 1bfa8f3

Browse files
committed
fix: message pact verification code
1 parent f079909 commit 1bfa8f3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/pact/provider/rspec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def describe_message expected_response, interaction_context
108108
include Pact::RSpec::Matchers
109109
extend Pact::Matchers::Messages
110110

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

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

0 commit comments

Comments
 (0)