Skip to content

Instantly share code, notes, and snippets.

@tkanov
Last active September 29, 2016 12:52
Show Gist options
  • Save tkanov/e154d9bf36d14882cf2a1b8470c44939 to your computer and use it in GitHub Desktop.
Save tkanov/e154d9bf36d14882cf2a1b8470c44939 to your computer and use it in GitHub Desktop.
# ...
json_response = JSON.parse(response.body)
# Look only at 'attributes' part of both arrays (expected and actual)
assert_same_elements json_response['attributes'], expected['attributes']
# Compare for equality excluding 'attributes' from both arrays
assert_equal json_response.except('attributes'), expected.except('attributes')
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment