File tree 2 files changed +8
-2
lines changed
spec/lib/pact_broker/pacts
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,9 @@ def self.from_path_info path_info
23
23
def self . from_request request , path_info
24
24
json_content = request . body . to_s
25
25
parsed_content = begin
26
- JSON . parse ( json_content , PACT_PARSING_OPTIONS )
26
+ parsed = JSON . parse ( json_content , PACT_PARSING_OPTIONS )
27
+ json_content = parsed . to_json # remove whitespace
28
+ parsed
27
29
rescue
28
30
{ }
29
31
end
Original file line number Diff line number Diff line change @@ -67,7 +67,11 @@ module Pacts
67
67
end
68
68
69
69
it "extracts the json_content" do
70
- expect ( subject . json_content ) . to eq body
70
+ expect ( subject . json_content ) . to eq JSON . parse ( body ) . to_json
71
+ end
72
+
73
+ it "removes whitespace from the json_content" do
74
+ expect ( subject . json_content ) . to_not include "\n "
71
75
end
72
76
73
77
it "extracts the consumer name from the pact" do
You can’t perform that action at this time.
0 commit comments