Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON should include_json does not work #101

Open
ngonzalez opened this issue Dec 11, 2017 · 2 comments
Open

JSON should include_json does not work #101

ngonzalez opened this issue Dec 11, 2017 · 2 comments

Comments

@ngonzalez
Copy link

ngonzalez commented Dec 11, 2017

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
@ryanoboril
Copy link

+1

@frodera
Copy link

frodera commented Apr 30, 2018

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. 😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants