{"action":"created","comment":{"url":"https://api.github.com/repos/danmcclain/voorhees/pulls/comments/38315832","id":38315832,"diff_hunk":"@@ -19,6 +19,33 @@ defmodule Voorhees.JSONApi do\n     actual\n   end\n \n+  def assert_schema_contains(%{\"data\" => resource} = actual, expected) when is_map(resource) do\n+    assert_schema_contains(put_in(actual[\"data\"], [resource]), expected)\n+  end\n+  def assert_schema_contains(%{\"data\" => resources} = actual, expected) when is_list(resources) do\n+    actual = Enum.map(resources ++ actual[\"included\"] || [], fn(resource) -> _stringify_keys(resource) end)\n+    _assert_schema_contains(actual, _stringify_keys(expected))\n+  end\n+\n+  defp _assert_schema_contains(actual, expected) do\n+    actual_types = Enum.map(actual, fn(resource) -> resource[\"type\"] end)\n+    expected_types = Map.keys(expected)\n+\n+    assert length(expected_types -- actual_types) == 0,","path":"lib/voorhees/json_api.ex","position":16,"original_position":16,"commit_id":"10d7eb8d5669a552471a5df02d0f9bb77fd0305e","original_commit_id":"10d7eb8d5669a552471a5df02d0f9bb77fd0305e","user":{"login":"danmcclain","id":144138,"avatar_url":"https://avatars.githubusercontent.com/u/144138?v=3","gravatar_id":"","url":"https://api.github.com/users/danmcclain","html_url":"https://github.com/danmcclain","followers_url":"https://api.github.com/users/danmcclain/followers","following_url":"https://api.github.com/users/danmcclain/following{/other_user}","gists_url":"https://api.github.com/users/danmcclain/gists{/gist_id}","starred_url":"https://api.github.com/users/danmcclain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danmcclain/subscriptions","organizations_url":"https://api.github.com/users/danmcclain/orgs","repos_url":"https://api.github.com/users/danmcclain/repos","events_url":"https://api.github.com/users/danmcclain/events{/privacy}","received_events_url":"https://api.github.com/users/danmcclain/received_events","type":"User","site_admin":false},"body":"Just making sure, have used both orders when making a hard match. :+1: ","created_at":"2015-08-31T14:18:01Z","updated_at":"2015-08-31T14:18:01Z","html_url":"https://github.com/danmcclain/voorhees/pull/11#discussion_r38315832","pull_request_url":"https://api.github.com/repos/danmcclain/voorhees/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/danmcclain/voorhees/pulls/comments/38315832"},"html":{"href":"https://github.com/danmcclain/voorhees/pull/11#discussion_r38315832"},"pull_request":{"href":"https://api.github.com/repos/danmcclain/voorhees/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/danmcclain/voorhees/pulls/11","id":43767791,"html_url":"https://github.com/danmcclain/voorhees/pull/11","diff_url":"https://github.com/danmcclain/voorhees/pull/11.diff","patch_url":"https://github.com/danmcclain/voorhees/pull/11.patch","issue_url":"https://api.github.com/repos/danmcclain/voorhees/issues/11","number":11,"state":"open","locked":false,"title":"Adds support for schema contains assertions","user":{"login":"bcardarella","id":18524,"avatar_url":"https://avatars.githubusercontent.com/u/18524?v=3","gravatar_id":"","url":"https://api.github.com/users/bcardarella","html_url":"https://github.com/bcardarella","followers_url":"https://api.github.com/users/bcardarella/followers","following_url":"https://api.github.com/users/bcardarella/following{/other_user}","gists_url":"https://api.github.com/users/bcardarella/gists{/gist_id}","starred_url":"https://api.github.com/users/bcardarella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcardarella/subscriptions","organizations_url":"https://api.github.com/users/bcardarella/orgs","repos_url":"https://api.github.com/users/bcardarella/repos","events_url":"https://api.github.com/users/bcardarella/events{/privacy}","received_events_url":"https://api.github.com/users/bcardarella/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-31T14:08:00Z","updated_at":"2015-08-31T14:18:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"30f941d6ebf3e4f12f97777280290f6d23d52e9c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/danmcclain/voorhees/pulls/11/commits","review_comments_url":"https://api.github.com/repos/danmcclain/voorhees/pulls/11/comments","review_comment_url":"https://api.github.com/repos/danmcclain/voorhees/pulls/comments{/number}","comments_url":"https://api.github.com/repos/danmcclain/voorhees/issues/11/comments","statuses_url":"https://api.github.com/repos/danmcclain/voorhees/statuses/10d7eb8d5669a552471a5df02d0f9bb77fd0305e","head":{"label":"bcardarella:bc-schema-contains","ref":"bc-schema-contains","sha":"10d7eb8d5669a552471a5df02d0f9bb77fd0305e","user":{"login":"bcardarella","id":18524,"avatar_url":"https://avatars.githubusercontent.com/u/18524?v=3","gravatar_id":"","url":"https://api.github.com/users/bcardarella","html_url":"https://github.com/bcardarella","followers_url":"https://api.github.com/users/bcardarella/followers","following_url":"https://api.github.com/users/bcardarella/following{/other_user}","gists_url":"https://api.github.com/users/bcardarella/gists{/gist_id}","starred_url":"https://api.github.com/users/bcardarella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcardarella/subscriptions","organizations_url":"https://api.github.com/users/bcardarella/orgs","repos_url":"https://api.github.com/users/bcardarella/repos","events_url":"https://api.github.com/users/bcardarella/events{/privacy}","received_events_url":"https://api.github.com/users/bcardarella/received_events","type":"User","site_admin":false},"repo":{"id":41671380,"name":"voorhees","full_name":"bcardarella/voorhees","owner":{"login":"bcardarella","id":18524,"avatar_url":"https://avatars.githubusercontent.com/u/18524?v=3","gravatar_id":"","url":"https://api.github.com/users/bcardarella","html_url":"https://github.com/bcardarella","followers_url":"https://api.github.com/users/bcardarella/followers","following_url":"https://api.github.com/users/bcardarella/following{/other_user}","gists_url":"https://api.github.com/users/bcardarella/gists{/gist_id}","starred_url":"https://api.github.com/users/bcardarella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcardarella/subscriptions","organizations_url":"https://api.github.com/users/bcardarella/orgs","repos_url":"https://api.github.com/users/bcardarella/repos","events_url":"https://api.github.com/users/bcardarella/events{/privacy}","received_events_url":"https://api.github.com/users/bcardarella/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bcardarella/voorhees","description":null,"fork":true,"url":"https://api.github.com/repos/bcardarella/voorhees","forks_url":"https://api.github.com/repos/bcardarella/voorhees/forks","keys_url":"https://api.github.com/repos/bcardarella/voorhees/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bcardarella/voorhees/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bcardarella/voorhees/teams","hooks_url":"https://api.github.com/repos/bcardarella/voorhees/hooks","issue_events_url":"https://api.github.com/repos/bcardarella/voorhees/issues/events{/number}","events_url":"https://api.github.com/repos/bcardarella/voorhees/events","assignees_url":"https://api.github.com/repos/bcardarella/voorhees/assignees{/user}","branches_url":"https://api.github.com/repos/bcardarella/voorhees/branches{/branch}","tags_url":"https://api.github.com/repos/bcardarella/voorhees/tags","blobs_url":"https://api.github.com/repos/bcardarella/voorhees/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bcardarella/voorhees/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bcardarella/voorhees/git/refs{/sha}","trees_url":"https://api.github.com/repos/bcardarella/voorhees/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bcardarella/voorhees/statuses/{sha}","languages_url":"https://api.github.com/repos/bcardarella/voorhees/languages","stargazers_url":"https://api.github.com/repos/bcardarella/voorhees/stargazers","contributors_url":"https://api.github.com/repos/bcardarella/voorhees/contributors","subscribers_url":"https://api.github.com/repos/bcardarella/voorhees/subscribers","subscription_url":"https://api.github.com/repos/bcardarella/voorhees/subscription","commits_url":"https://api.github.com/repos/bcardarella/voorhees/commits{/sha}","git_commits_url":"https://api.github.com/repos/bcardarella/voorhees/git/commits{/sha}","comments_url":"https://api.github.com/repos/bcardarella/voorhees/comments{/number}","issue_comment_url":"https://api.github.com/repos/bcardarella/voorhees/issues/comments{/number}","contents_url":"https://api.github.com/repos/bcardarella/voorhees/contents/{+path}","compare_url":"https://api.github.com/repos/bcardarella/voorhees/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bcardarella/voorhees/merges","archive_url":"https://api.github.com/repos/bcardarella/voorhees/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bcardarella/voorhees/downloads","issues_url":"https://api.github.com/repos/bcardarella/voorhees/issues{/number}","pulls_url":"https://api.github.com/repos/bcardarella/voorhees/pulls{/number}","milestones_url":"https://api.github.com/repos/bcardarella/voorhees/milestones{/number}","notifications_url":"https://api.github.com/repos/bcardarella/voorhees/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bcardarella/voorhees/labels{/name}","releases_url":"https://api.github.com/repos/bcardarella/voorhees/releases{/id}","created_at":"2015-08-31T11:16:07Z","updated_at":"2015-08-31T11:16:07Z","pushed_at":"2015-08-31T14:08:43Z","git_url":"git://github.com/bcardarella/voorhees.git","ssh_url":"git@github.com:bcardarella/voorhees.git","clone_url":"https://github.com/bcardarella/voorhees.git","svn_url":"https://github.com/bcardarella/voorhees","homepage":null,"size":216,"stargazers_count":0,"watchers_count":0,"language":"Elixir","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"danmcclain:json-api-assertions","ref":"json-api-assertions","sha":"84f6058c8a36f8f1c7bb7c16532f7c437b31409d","user":{"login":"danmcclain","id":144138,"avatar_url":"https://avatars.githubusercontent.com/u/144138?v=3","gravatar_id":"","url":"https://api.github.com/users/danmcclain","html_url":"https://github.com/danmcclain","followers_url":"https://api.github.com/users/danmcclain/followers","following_url":"https://api.github.com/users/danmcclain/following{/other_user}","gists_url":"https://api.github.com/users/danmcclain/gists{/gist_id}","starred_url":"https://api.github.com/users/danmcclain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danmcclain/subscriptions","organizations_url":"https://api.github.com/users/danmcclain/orgs","repos_url":"https://api.github.com/users/danmcclain/repos","events_url":"https://api.github.com/users/danmcclain/events{/privacy}","received_events_url":"https://api.github.com/users/danmcclain/received_events","type":"User","site_admin":false},"repo":{"id":34800960,"name":"voorhees","full_name":"danmcclain/voorhees","owner":{"login":"danmcclain","id":144138,"avatar_url":"https://avatars.githubusercontent.com/u/144138?v=3","gravatar_id":"","url":"https://api.github.com/users/danmcclain","html_url":"https://github.com/danmcclain","followers_url":"https://api.github.com/users/danmcclain/followers","following_url":"https://api.github.com/users/danmcclain/following{/other_user}","gists_url":"https://api.github.com/users/danmcclain/gists{/gist_id}","starred_url":"https://api.github.com/users/danmcclain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danmcclain/subscriptions","organizations_url":"https://api.github.com/users/danmcclain/orgs","repos_url":"https://api.github.com/users/danmcclain/repos","events_url":"https://api.github.com/users/danmcclain/events{/privacy}","received_events_url":"https://api.github.com/users/danmcclain/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danmcclain/voorhees","description":null,"fork":false,"url":"https://api.github.com/repos/danmcclain/voorhees","forks_url":"https://api.github.com/repos/danmcclain/voorhees/forks","keys_url":"https://api.github.com/repos/danmcclain/voorhees/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danmcclain/voorhees/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danmcclain/voorhees/teams","hooks_url":"https://api.github.com/repos/danmcclain/voorhees/hooks","issue_events_url":"https://api.github.com/repos/danmcclain/voorhees/issues/events{/number}","events_url":"https://api.github.com/repos/danmcclain/voorhees/events","assignees_url":"https://api.github.com/repos/danmcclain/voorhees/assignees{/user}","branches_url":"https://api.github.com/repos/danmcclain/voorhees/branches{/branch}","tags_url":"https://api.github.com/repos/danmcclain/voorhees/tags","blobs_url":"https://api.github.com/repos/danmcclain/voorhees/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danmcclain/voorhees/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danmcclain/voorhees/git/refs{/sha}","trees_url":"https://api.github.com/repos/danmcclain/voorhees/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danmcclain/voorhees/statuses/{sha}","languages_url":"https://api.github.com/repos/danmcclain/voorhees/languages","stargazers_url":"https://api.github.com/repos/danmcclain/voorhees/stargazers","contributors_url":"https://api.github.com/repos/danmcclain/voorhees/contributors","subscribers_url":"https://api.github.com/repos/danmcclain/voorhees/subscribers","subscription_url":"https://api.github.com/repos/danmcclain/voorhees/subscription","commits_url":"https://api.github.com/repos/danmcclain/voorhees/commits{/sha}","git_commits_url":"https://api.github.com/repos/danmcclain/voorhees/git/commits{/sha}","comments_url":"https://api.github.com/repos/danmcclain/voorhees/comments{/number}","issue_comment_url":"https://api.github.com/repos/danmcclain/voorhees/issues/comments{/number}","contents_url":"https://api.github.com/repos/danmcclain/voorhees/contents/{+path}","compare_url":"https://api.github.com/repos/danmcclain/voorhees/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danmcclain/voorhees/merges","archive_url":"https://api.github.com/repos/danmcclain/voorhees/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danmcclain/voorhees/downloads","issues_url":"https://api.github.com/repos/danmcclain/voorhees/issues{/number}","pulls_url":"https://api.github.com/repos/danmcclain/voorhees/pulls{/number}","milestones_url":"https://api.github.com/repos/danmcclain/voorhees/milestones{/number}","notifications_url":"https://api.github.com/repos/danmcclain/voorhees/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danmcclain/voorhees/labels{/name}","releases_url":"https://api.github.com/repos/danmcclain/voorhees/releases{/id}","created_at":"2015-04-29T15:10:38Z","updated_at":"2015-08-19T14:40:51Z","pushed_at":"2015-08-31T14:08:43Z","git_url":"git://github.com/danmcclain/voorhees.git","ssh_url":"git@github.com:danmcclain/voorhees.git","clone_url":"https://github.com/danmcclain/voorhees.git","svn_url":"https://github.com/danmcclain/voorhees","homepage":null,"size":216,"stargazers_count":10,"watchers_count":10,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":5,"forks":4,"open_issues":5,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/danmcclain/voorhees/pulls/11"},"html":{"href":"https://github.com/danmcclain/voorhees/pull/11"},"issue":{"href":"https://api.github.com/repos/danmcclain/voorhees/issues/11"},"comments":{"href":"https://api.github.com/repos/danmcclain/voorhees/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/danmcclain/voorhees/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/danmcclain/voorhees/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/danmcclain/voorhees/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/danmcclain/voorhees/statuses/10d7eb8d5669a552471a5df02d0f9bb77fd0305e"}}}}