{"action":"created","issue":{"url":"https://api.github.com/repos/JarrodCTaylor/fauxjax/issues/19","labels_url":"https://api.github.com/repos/JarrodCTaylor/fauxjax/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/JarrodCTaylor/fauxjax/issues/19/comments","events_url":"https://api.github.com/repos/JarrodCTaylor/fauxjax/issues/19/events","html_url":"https://github.com/JarrodCTaylor/fauxjax/pull/19","id":102050526,"number":19,"title":"[ENHANCEMENT] adding the ability to compare JSON.stringify'd data","user":{"login":"williamsbdev","id":2402655,"avatar_url":"https://avatars.githubusercontent.com/u/2402655?v=3","gravatar_id":"","url":"https://api.github.com/users/williamsbdev","html_url":"https://github.com/williamsbdev","followers_url":"https://api.github.com/users/williamsbdev/followers","following_url":"https://api.github.com/users/williamsbdev/following{/other_user}","gists_url":"https://api.github.com/users/williamsbdev/gists{/gist_id}","starred_url":"https://api.github.com/users/williamsbdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/williamsbdev/subscriptions","organizations_url":"https://api.github.com/users/williamsbdev/orgs","repos_url":"https://api.github.com/users/williamsbdev/repos","events_url":"https://api.github.com/users/williamsbdev/events{/privacy}","received_events_url":"https://api.github.com/users/williamsbdev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-20T03:09:45Z","updated_at":"2015-08-20T18:23:33Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/JarrodCTaylor/fauxjax/pulls/19","html_url":"https://github.com/JarrodCTaylor/fauxjax/pull/19","diff_url":"https://github.com/JarrodCTaylor/fauxjax/pull/19.diff","patch_url":"https://github.com/JarrodCTaylor/fauxjax/pull/19.patch"},"body":"@JarrodCTaylor, we ran into this issue where our real request data and mock data was `JSON.stringify'd` and when we would do the compare, it would fail because the keys were not in the same order.\r\n\r\nI added a test to show that keys out of order of a regular object \"match\" but when `JSON.stringify'd`, they do not.\r\n\r\nWe initially thought it was in this [library](https://github.com/toranb/ember-cli-test-helpers/issues/19) but upon my further investigation, it is in fact something that we think should be handled here. This is my first stab at the fix for this.\r\n\r\n## PLEASE do not merge this as is. ##\r\nI believe it needs some work to remain consistent with this project's style and I am not proud of the code but it has the passing test so we can refactor to make it what you would find as acceptable.\r\n\r\nThanks!\r\n\r\ncc @toranb @benkiefer"},"comment":{"url":"https://api.github.com/repos/JarrodCTaylor/fauxjax/issues/comments/133108612","html_url":"https://github.com/JarrodCTaylor/fauxjax/pull/19#issuecomment-133108612","issue_url":"https://api.github.com/repos/JarrodCTaylor/fauxjax/issues/19","id":133108612,"user":{"login":"williamsbdev","id":2402655,"avatar_url":"https://avatars.githubusercontent.com/u/2402655?v=3","gravatar_id":"","url":"https://api.github.com/users/williamsbdev","html_url":"https://github.com/williamsbdev","followers_url":"https://api.github.com/users/williamsbdev/followers","following_url":"https://api.github.com/users/williamsbdev/following{/other_user}","gists_url":"https://api.github.com/users/williamsbdev/gists{/gist_id}","starred_url":"https://api.github.com/users/williamsbdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/williamsbdev/subscriptions","organizations_url":"https://api.github.com/users/williamsbdev/orgs","repos_url":"https://api.github.com/users/williamsbdev/repos","events_url":"https://api.github.com/users/williamsbdev/events{/privacy}","received_events_url":"https://api.github.com/users/williamsbdev/received_events","type":"User","site_admin":false},"created_at":"2015-08-20T18:23:32Z","updated_at":"2015-08-20T18:23:32Z","body":"@JarrodCTaylor we really want to be able to match our request data/mock data even though it is `JSON.stringify` on the keys and values and not on the literal string. What do you think of giving us a hook to compare the data ourselves? Potentially something that we can override via the settings with our own function."}}