collectiveidea / json_spec

Easily handle JSON in RSpec and Cucumber
rubygems.org/gems/json_spec
MIT License
919 stars 114 forks source link

Add have_json_value matcher #103

Open mcnelson opened 6 years ago

mcnelson commented 6 years ago

This is a continuation of this PR. I've been looking for nicer ways to test JSON responses and came across this gem.

Currently the best way to test single values is something like:

expect(response.body).to be_json_eql(some_string.inspect).at_path('foo/bar/id')

Since the other PR is years old now and seemingly abandoned, I took a minute to make the changes requested and reopen this.

Let me know if I missed anything.