{"action":"created","comment":{"url":"https://api.github.com/repos/openfarmcc/OpenFarm/pulls/comments/34952467","id":34952467,"diff_hunk":"@@ -11,30 +12,30 @@\n   end\n \n   it 'lists crops.' do\n-    get 'index', format: :json, query: 'mung'\n+    get 'index', format: :json, filter: 'mung'\n     expect(response.status).to eq(200)\n-    expect(json.length).to eq(1)\n-    expect(json['crops'][0]['_id']).to eq(@beans.id.to_s)\n+    expect(json['data'].length).to eq(1)\n+    expect(json['data'][0]['id']).to eq(@beans.id.to_s)\n   end\n \n   it 'returns [] for tiny searches' do\n     DocYoSelf.skip\n     get 'index', format: :json, query: 'mu'\n     expect(response.status).to eq(200)\n-    expect(json).to eq('crops' => [])\n+    expect(json).to eq('data' => [])\n   end\n \n   it 'should show a crop' do\n     crop = FactoryGirl.create(:crop)\n     get 'show', format: :json, id: crop.id\n     expect(response.status).to eq(200)\n-    expect(json['crop']['name']).to eq(crop.name)\n+    expect(json['data']['attributes']['name']).to eq(crop.name)\n   end\n \n   it 'should update a crop' do\n     sign_in user\n     crop = FactoryGirl.create(:crop)\n-    put :update, id: crop.id, crop: { description: 'Updated' }\n+    put :update, id: crop.id, data: { attributes: { description: 'Updated' }}","path":"spec/controllers/api/api_crops_controller_spec.rb","position":43,"original_position":43,"commit_id":"007ad6ef7d4d5cbe053d0179af20d7f3da9de492","original_commit_id":"007ad6ef7d4d5cbe053d0179af20d7f3da9de492","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Space inside } missing.","created_at":"2015-07-18T22:36:37Z","updated_at":"2015-07-18T22:36:37Z","html_url":"https://github.com/openfarmcc/OpenFarm/pull/661#discussion_r34952467","pull_request_url":"https://api.github.com/repos/openfarmcc/OpenFarm/pulls/661","_links":{"self":{"href":"https://api.github.com/repos/openfarmcc/OpenFarm/pulls/comments/34952467"},"html":{"href":"https://github.com/openfarmcc/OpenFarm/pull/661#discussion_r34952467"},"pull_request":{"href":"https://api.github.com/repos/openfarmcc/OpenFarm/pulls/661"}}},"pull_request":{"url":"https://api.github.com/repos/openfarmcc/OpenFarm/pulls/661","id":40286926,"html_url":"https://github.com/openfarmcc/OpenFarm/pull/661","diff_url":"https://github.com/openfarmcc/OpenFarm/pull/661.diff","patch_url":"https://github.com/openfarmcc/OpenFarm/pull/661.patch","issue_url":"https://api.github.com/repos/openfarmcc/OpenFarm/issues/661","number":661,"state":"open","locked":false,"title":"Close #241: Add JSON-API","user":{"login":"simonv3","id":485583,"avatar_url":"https://avatars.githubusercontent.com/u/485583?v=3","gravatar_id":"","url":"https://api.github.com/users/simonv3","html_url":"https://github.com/simonv3","followers_url":"https://api.github.com/users/simonv3/followers","following_url":"https://api.github.com/users/simonv3/following{/other_user}","gists_url":"https://api.github.com/users/simonv3/gists{/gist_id}","starred_url":"https://api.github.com/users/simonv3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonv3/subscriptions","organizations_url":"https://api.github.com/users/simonv3/orgs","repos_url":"https://api.github.com/users/simonv3/repos","events_url":"https://api.github.com/users/simonv3/events{/privacy}","received_events_url":"https://api.github.com/users/simonv3/received_events","type":"User","site_admin":false},"body":"This is a **big** change.\r\n\r\n# What's Changed.\r\n* All of the *existing* API endpoints now conform to the [JSON-API](http://jsonapi.org/) standard. The API has also been moved to a route that starts with `/api/v1/`. This way we'll be able to iterate over the API in the future without making existing things break. Hopefully. The v1 api is not done. There are certain routes that the gem used [jsonapi-serializers](https://github.com/fotinakis/jsonapi-serializers) that we don't have yet. Don't trust URLs returned in the API. For full documentation on the API `api_docs.md` has been updated. I now point you to it.\r\n* The front-end has been restructured to match this. There's now more complete services. Angular makes more sense. Things are more compartmentalized. They're scope being used appropriately. This isn't top-notch yet, but it's good progress.\r\n\r\nHound, have at it!\r\n\r\n(I will respond to hound tomorrow I hope). ","created_at":"2015-07-18T05:13:44Z","updated_at":"2015-07-18T22:36:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d3527a99314c21a16f44bcd69ca0b3e6fcae29a4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openfarmcc/OpenFarm/pulls/661/commits","review_comments_url":"https://api.github.com/repos/openfarmcc/OpenFarm/pulls/661/comments","review_comment_url":"https://api.github.com/repos/openfarmcc/OpenFarm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openfarmcc/OpenFarm/issues/661/comments","statuses_url":"https://api.github.com/repos/openfarmcc/OpenFarm/statuses/007ad6ef7d4d5cbe053d0179af20d7f3da9de492","head":{"label":"simonv3:241-json-api","ref":"241-json-api","sha":"007ad6ef7d4d5cbe053d0179af20d7f3da9de492","user":{"login":"simonv3","id":485583,"avatar_url":"https://avatars.githubusercontent.com/u/485583?v=3","gravatar_id":"","url":"https://api.github.com/users/simonv3","html_url":"https://github.com/simonv3","followers_url":"https://api.github.com/users/simonv3/followers","following_url":"https://api.github.com/users/simonv3/following{/other_user}","gists_url":"https://api.github.com/users/simonv3/gists{/gist_id}","starred_url":"https://api.github.com/users/simonv3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonv3/subscriptions","organizations_url":"https://api.github.com/users/simonv3/orgs","repos_url":"https://api.github.com/users/simonv3/repos","events_url":"https://api.github.com/users/simonv3/events{/privacy}","received_events_url":"https://api.github.com/users/simonv3/received_events","type":"User","site_admin":false},"repo":{"id":21980604,"name":"OpenFarm","full_name":"simonv3/OpenFarm","owner":{"login":"simonv3","id":485583,"avatar_url":"https://avatars.githubusercontent.com/u/485583?v=3","gravatar_id":"","url":"https://api.github.com/users/simonv3","html_url":"https://github.com/simonv3","followers_url":"https://api.github.com/users/simonv3/followers","following_url":"https://api.github.com/users/simonv3/following{/other_user}","gists_url":"https://api.github.com/users/simonv3/gists{/gist_id}","starred_url":"https://api.github.com/users/simonv3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonv3/subscriptions","organizations_url":"https://api.github.com/users/simonv3/orgs","repos_url":"https://api.github.com/users/simonv3/repos","events_url":"https://api.github.com/users/simonv3/events{/privacy}","received_events_url":"https://api.github.com/users/simonv3/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/simonv3/OpenFarm","description":"A free and open database for farming and gardening knowledge. Data will be crowdsourced and rated. Will feature advanced search of the plant database, responsive frontend, forum for community discussion on each entry, and an open API.","fork":true,"url":"https://api.github.com/repos/simonv3/OpenFarm","forks_url":"https://api.github.com/repos/simonv3/OpenFarm/forks","keys_url":"https://api.github.com/repos/simonv3/OpenFarm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simonv3/OpenFarm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simonv3/OpenFarm/teams","hooks_url":"https://api.github.com/repos/simonv3/OpenFarm/hooks","issue_events_url":"https://api.github.com/repos/simonv3/OpenFarm/issues/events{/number}","events_url":"https://api.github.com/repos/simonv3/OpenFarm/events","assignees_url":"https://api.github.com/repos/simonv3/OpenFarm/assignees{/user}","branches_url":"https://api.github.com/repos/simonv3/OpenFarm/branches{/branch}","tags_url":"https://api.github.com/repos/simonv3/OpenFarm/tags","blobs_url":"https://api.github.com/repos/simonv3/OpenFarm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simonv3/OpenFarm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simonv3/OpenFarm/git/refs{/sha}","trees_url":"https://api.github.com/repos/simonv3/OpenFarm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simonv3/OpenFarm/statuses/{sha}","languages_url":"https://api.github.com/repos/simonv3/OpenFarm/languages","stargazers_url":"https://api.github.com/repos/simonv3/OpenFarm/stargazers","contributors_url":"https://api.github.com/repos/simonv3/OpenFarm/contributors","subscribers_url":"https://api.github.com/repos/simonv3/OpenFarm/subscribers","subscription_url":"https://api.github.com/repos/simonv3/OpenFarm/subscription","commits_url":"https://api.github.com/repos/simonv3/OpenFarm/commits{/sha}","git_commits_url":"https://api.github.com/repos/simonv3/OpenFarm/git/commits{/sha}","comments_url":"https://api.github.com/repos/simonv3/OpenFarm/comments{/number}","issue_comment_url":"https://api.github.com/repos/simonv3/OpenFarm/issues/comments{/number}","contents_url":"https://api.github.com/repos/simonv3/OpenFarm/contents/{+path}","compare_url":"https://api.github.com/repos/simonv3/OpenFarm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simonv3/OpenFarm/merges","archive_url":"https://api.github.com/repos/simonv3/OpenFarm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simonv3/OpenFarm/downloads","issues_url":"https://api.github.com/repos/simonv3/OpenFarm/issues{/number}","pulls_url":"https://api.github.com/repos/simonv3/OpenFarm/pulls{/number}","milestones_url":"https://api.github.com/repos/simonv3/OpenFarm/milestones{/number}","notifications_url":"https://api.github.com/repos/simonv3/OpenFarm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simonv3/OpenFarm/labels{/name}","releases_url":"https://api.github.com/repos/simonv3/OpenFarm/releases{/id}","created_at":"2014-07-18T13:09:02Z","updated_at":"2015-05-06T06:40:22Z","pushed_at":"2015-07-18T22:36:04Z","git_url":"git://github.com/simonv3/OpenFarm.git","ssh_url":"git@github.com:simonv3/OpenFarm.git","clone_url":"https://github.com/simonv3/OpenFarm.git","svn_url":"https://github.com/simonv3/OpenFarm","homepage":"OpenFarm.cc","size":74579,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"openfarmcc:master","ref":"master","sha":"03b9b1c7b3e40e1785eb97332afe02c363f5bd0d","user":{"login":"openfarmcc","id":10136787,"avatar_url":"https://avatars.githubusercontent.com/u/10136787?v=3","gravatar_id":"","url":"https://api.github.com/users/openfarmcc","html_url":"https://github.com/openfarmcc","followers_url":"https://api.github.com/users/openfarmcc/followers","following_url":"https://api.github.com/users/openfarmcc/following{/other_user}","gists_url":"https://api.github.com/users/openfarmcc/gists{/gist_id}","starred_url":"https://api.github.com/users/openfarmcc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openfarmcc/subscriptions","organizations_url":"https://api.github.com/users/openfarmcc/orgs","repos_url":"https://api.github.com/users/openfarmcc/repos","events_url":"https://api.github.com/users/openfarmcc/events{/privacy}","received_events_url":"https://api.github.com/users/openfarmcc/received_events","type":"Organization","site_admin":false},"repo":{"id":13895958,"name":"OpenFarm","full_name":"openfarmcc/OpenFarm","owner":{"login":"openfarmcc","id":10136787,"avatar_url":"https://avatars.githubusercontent.com/u/10136787?v=3","gravatar_id":"","url":"https://api.github.com/users/openfarmcc","html_url":"https://github.com/openfarmcc","followers_url":"https://api.github.com/users/openfarmcc/followers","following_url":"https://api.github.com/users/openfarmcc/following{/other_user}","gists_url":"https://api.github.com/users/openfarmcc/gists{/gist_id}","starred_url":"https://api.github.com/users/openfarmcc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openfarmcc/subscriptions","organizations_url":"https://api.github.com/users/openfarmcc/orgs","repos_url":"https://api.github.com/users/openfarmcc/repos","events_url":"https://api.github.com/users/openfarmcc/events{/privacy}","received_events_url":"https://api.github.com/users/openfarmcc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openfarmcc/OpenFarm","description":"A free and open database for farming and gardening knowledge. You can grow anything!","fork":false,"url":"https://api.github.com/repos/openfarmcc/OpenFarm","forks_url":"https://api.github.com/repos/openfarmcc/OpenFarm/forks","keys_url":"https://api.github.com/repos/openfarmcc/OpenFarm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openfarmcc/OpenFarm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openfarmcc/OpenFarm/teams","hooks_url":"https://api.github.com/repos/openfarmcc/OpenFarm/hooks","issue_events_url":"https://api.github.com/repos/openfarmcc/OpenFarm/issues/events{/number}","events_url":"https://api.github.com/repos/openfarmcc/OpenFarm/events","assignees_url":"https://api.github.com/repos/openfarmcc/OpenFarm/assignees{/user}","branches_url":"https://api.github.com/repos/openfarmcc/OpenFarm/branches{/branch}","tags_url":"https://api.github.com/repos/openfarmcc/OpenFarm/tags","blobs_url":"https://api.github.com/repos/openfarmcc/OpenFarm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openfarmcc/OpenFarm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openfarmcc/OpenFarm/git/refs{/sha}","trees_url":"https://api.github.com/repos/openfarmcc/OpenFarm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openfarmcc/OpenFarm/statuses/{sha}","languages_url":"https://api.github.com/repos/openfarmcc/OpenFarm/languages","stargazers_url":"https://api.github.com/repos/openfarmcc/OpenFarm/stargazers","contributors_url":"https://api.github.com/repos/openfarmcc/OpenFarm/contributors","subscribers_url":"https://api.github.com/repos/openfarmcc/OpenFarm/subscribers","subscription_url":"https://api.github.com/repos/openfarmcc/OpenFarm/subscription","commits_url":"https://api.github.com/repos/openfarmcc/OpenFarm/commits{/sha}","git_commits_url":"https://api.github.com/repos/openfarmcc/OpenFarm/git/commits{/sha}","comments_url":"https://api.github.com/repos/openfarmcc/OpenFarm/comments{/number}","issue_comment_url":"https://api.github.com/repos/openfarmcc/OpenFarm/issues/comments{/number}","contents_url":"https://api.github.com/repos/openfarmcc/OpenFarm/contents/{+path}","compare_url":"https://api.github.com/repos/openfarmcc/OpenFarm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openfarmcc/OpenFarm/merges","archive_url":"https://api.github.com/repos/openfarmcc/OpenFarm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openfarmcc/OpenFarm/downloads","issues_url":"https://api.github.com/repos/openfarmcc/OpenFarm/issues{/number}","pulls_url":"https://api.github.com/repos/openfarmcc/OpenFarm/pulls{/number}","milestones_url":"https://api.github.com/repos/openfarmcc/OpenFarm/milestones{/number}","notifications_url":"https://api.github.com/repos/openfarmcc/OpenFarm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openfarmcc/OpenFarm/labels{/name}","releases_url":"https://api.github.com/repos/openfarmcc/OpenFarm/releases{/id}","created_at":"2013-10-27T04:46:37Z","updated_at":"2015-07-15T00:33:39Z","pushed_at":"2015-07-18T22:36:04Z","git_url":"git://github.com/openfarmcc/OpenFarm.git","ssh_url":"git@github.com:openfarmcc/OpenFarm.git","clone_url":"https://github.com/openfarmcc/OpenFarm.git","svn_url":"https://github.com/openfarmcc/OpenFarm","homepage":"https://OpenFarm.cc","size":75789,"stargazers_count":261,"watchers_count":261,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":66,"mirror_url":null,"open_issues_count":62,"forks":66,"open_issues":62,"watchers":261,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openfarmcc/OpenFarm/pulls/661"},"html":{"href":"https://github.com/openfarmcc/OpenFarm/pull/661"},"issue":{"href":"https://api.github.com/repos/openfarmcc/OpenFarm/issues/661"},"comments":{"href":"https://api.github.com/repos/openfarmcc/OpenFarm/issues/661/comments"},"review_comments":{"href":"https://api.github.com/repos/openfarmcc/OpenFarm/pulls/661/comments"},"review_comment":{"href":"https://api.github.com/repos/openfarmcc/OpenFarm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openfarmcc/OpenFarm/pulls/661/commits"},"statuses":{"href":"https://api.github.com/repos/openfarmcc/OpenFarm/statuses/007ad6ef7d4d5cbe053d0179af20d7f3da9de492"}}}}