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

Add jsonapi rspec helper gem #10

Merged
merged 2 commits into from
Apr 18, 2022
Merged

Add jsonapi rspec helper gem #10

merged 2 commits into from
Apr 18, 2022

Conversation

zakariaf
Copy link
Owner

Add jsonapi-rspec which provides some beautiful RSpec matchers for JSON API

Some of the matchers:

Available matchers:

expect(document['data']).to have_id('12')
expect(document['data']).to have_type('users')
expect(document['data']).to have_jsonapi_attributes(:name, :email)
expect(document['data']).to have_jsonapi_attributes(:name, :email, :country).exactly
expect(document['data']).to have_attribute(:name).with_value('Lucas')
expect(document['data']).to have_relationships(:posts, :comments)

Check the gem GitHub page to see the list of all RSpec matchers

@zakariaf zakariaf merged commit 74ad609 into main Apr 18, 2022
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

Successfully merging this pull request may close these issues.

None yet

1 participant