Skip to content

Added support to check for equality of two resources #527

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
Jun 8, 2020

Conversation

rahulgdsouza
Copy link
Contributor

Why?

  1. Current setup does not support checking if two resources are equal.
  2. Current specs weren't tested with nested_fields which were typed.
    assert_equal initialized_api_resource.send(attribute), api_resource.send(attribute)

    Above spec results in a failure as it tries to equate two resources.

How?

  • Implemented .to_json at an ApiResource level
  • Equated based on .to_json representation of a resource

* Updated redundant specs
* Updated specs to check for resource equality
@rahulgdsouza rahulgdsouza force-pushed the rgd/resource_equality branch from ba8e7b7 to 8a522d4 Compare June 4, 2020 13:29
@rahulgdsouza rahulgdsouza marked this pull request as ready for review June 4, 2020 13:31
@rahulgdsouza rahulgdsouza merged commit eba6446 into conorkeating/sdk-v4.1 Jun 8, 2020
@rahulgdsouza rahulgdsouza deleted the rgd/resource_equality branch July 6, 2020 06:18
rahulgdsouza added a commit that referenced this pull request Jul 14, 2020
* Articles endpoint SDK support
* Collections Endpoint Support (#523)
* Sections Endpoint Support (#524)
* Added Collections endpoint SDK support
* Added test coverage
* Added dirty_tracking support for nested objects (#525)
* Added support to check for equality of two resources (#527)
* Updated README and logged changes for v4.1.0 (#526)
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