Skip to content

Check has_attribute instead of actual #28

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

Merged
merged 1 commit into from
Dec 19, 2020
Merged

Conversation

alexbeeken
Copy link
Contributor

check if attribute key exists instead of checking if attribute value exists, addresses case of attribute value being nil

What is the current behavior?

If the key is present in the attributes hash but the value of it is nil it will show a test failure message of this:

Screenshot from 2020-12-18 07-29-55

which is clearly incorrect as the key is present in the array

What is the new behavior?

It will now show the correct error message of a nil value when expecting a different value

Screenshot from 2020-12-18 07-30-11

more helpful error message

Checklist

Please make sure the following requirements are complete:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes /
    features)
  • All automated checks pass (CI/CD)

check if attribute key exists instead of checking if attribute value exists, addresses case of attribute value being nil
@stas stas merged commit c8cf8a0 into jsonapi-rb:master Dec 19, 2020
@stas
Copy link
Collaborator

stas commented Dec 19, 2020

Thank you @alexbeeken

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.

2 participants