json_spec
json_spec copied to clipboard
JSON should include_json does not work
With json_spec 1.1.5 and the following test:
it "matches json content with path" do
json = %({"item": {"id": "1"}})
json.should include_json(%({"id": "1"})).at_path("item")
end
Failures:
1) JsonSpec::Matchers::IncludeJson matches json content
Failure/Error: json.should include_json(%({"id": "1"})).at_path("item")
Expected {"item": {"id":"1" }} to include {"id": "1"} at path "item"
# ./spec/json_spec/matchers/include_json_spec.rb:44:in `block (2 levels) in <top (required)>'
Finished in 0.07838 seconds (files took 0.16929 seconds to load)
116 examples, 1 failure
Failed examples:
rspec ./spec/json_spec/matchers/include_json_spec.rb:42 # JsonSpec::Matchers::IncludeJson matches json content
+1
Same here. Running:
- Ruby 2.5.1
- multi_json (1.13.1)
- json_spec (1.1.5)
Edit: Per include_json_spec.rb that seems to be the intended behavior. 😕