{"action":"created","comment":{"url":"https://api.github.com/repos/VanPaitin/Restorp/pulls/comments/225932446","pull_request_review_id":165634780,"id":225932446,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNTkzMjQ0Ng==","diff_hunk":"@@ -0,0 +1,106 @@\n+require 'rails_helper'\n+require 'support/successful_response'\n+require 'support/not_found'\n+\n+RSpec.describe \"FetchRestaurants\", type: :request do\n+  context \"when there are no restaurants\" do\n+    before { get api_v1_restaurants_path }\n+\n+    it_behaves_like \"a 404 response\"\n+  end\n+\n+  context \"when there are restaurants\" do\n+    let!(:restaurant1) { create(:restaurant) }\n+    let!(:restaurant2) { create(:restaurant) }\n+    let(:cuisine) { create(:cuisine) }\n+    let!(:restaurant3) do\n+      restaurant = create(:restaurant)\n+      restaurant.cuisines << cuisine\n+      restaurant\n+    end\n+\n+    describe \"a successful response\" do\n+      before { get api_v1_restaurants_path }\n+\n+      it_behaves_like 'a successful response'\n+    end\n+\n+    context \"when there are no query parameters\" do\n+      before { get api_v1_restaurants_path }\n+\n+      it \"returns all the restaurants\" do\n+        expect(json(response.body)[:data].count).to eql 3\n+      end\n+    end\n+\n+    context \"when there are query parameters\" do\n+      context \"when we search restaurants by city\" do\n+        describe \"the data returned\" do\n+          before { get api_v1_restaurants_path, params: { city_id: restaurant1.city.id } }\n+\n+          it { expect(json(response.body)[:data].count).to eql 1 }\n+\n+          it \"returns only restaurants found in the city\" do\n+            expect(json(response.body)[:data][0][:name]).to eq restaurant1.name\n+          end\n+        end\n+\n+        it \"should call the by_city method\" do\n+          expect(Restaurant).to receive(:by_city).with(\"#{restaurant1.city.id}\").and_return([])\n+          expect(Restaurant).to_not receive(:search_by)\n+\n+          get api_v1_restaurants_path, params: { city_id: restaurant1.city.id }\n+        end\n+      end\n+\n+      context \"when we search restaurants by name\" do\n+        describe \"the data returned\" do\n+          before { get api_v1_restaurants_path, params: { query: restaurant2.name } }\n+\n+          it { expect(json(response.body)[:data].count).to eql 1 }\n+\n+          it \"returns only restaurants that matches the name\" do","path":"spec/requests/fetch_restaurants_spec.rb","position":62,"original_position":62,"commit_id":"2d9c3cf797a6dad11cd7c672d3e37c1671bc1632","original_commit_id":"2d9c3cf797a6dad11cd7c672d3e37c1671bc1632","user":{"login":"houndci-bot","id":6697940,"node_id":"MDQ6VXNlcjY2OTc5NDA=","avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.","created_at":"2018-10-17T13:40:11Z","updated_at":"2018-10-17T13:40:12Z","html_url":"https://github.com/VanPaitin/Restorp/pull/7#discussion_r225932446","pull_request_url":"https://api.github.com/repos/VanPaitin/Restorp/pulls/7","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/VanPaitin/Restorp/pulls/comments/225932446"},"html":{"href":"https://github.com/VanPaitin/Restorp/pull/7#discussion_r225932446"},"pull_request":{"href":"https://api.github.com/repos/VanPaitin/Restorp/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/VanPaitin/Restorp/pulls/7","id":223608108,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIzNjA4MTA4","html_url":"https://github.com/VanPaitin/Restorp/pull/7","diff_url":"https://github.com/VanPaitin/Restorp/pull/7.diff","patch_url":"https://github.com/VanPaitin/Restorp/pull/7.patch","issue_url":"https://api.github.com/repos/VanPaitin/Restorp/issues/7","number":7,"state":"open","locked":false,"title":"Add request specs for cities and restaurants controller","user":{"login":"VanPaitin","id":14159416,"node_id":"MDQ6VXNlcjE0MTU5NDE2","avatar_url":"https://avatars1.githubusercontent.com/u/14159416?v=4","gravatar_id":"","url":"https://api.github.com/users/VanPaitin","html_url":"https://github.com/VanPaitin","followers_url":"https://api.github.com/users/VanPaitin/followers","following_url":"https://api.github.com/users/VanPaitin/following{/other_user}","gists_url":"https://api.github.com/users/VanPaitin/gists{/gist_id}","starred_url":"https://api.github.com/users/VanPaitin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VanPaitin/subscriptions","organizations_url":"https://api.github.com/users/VanPaitin/orgs","repos_url":"https://api.github.com/users/VanPaitin/repos","events_url":"https://api.github.com/users/VanPaitin/events{/privacy}","received_events_url":"https://api.github.com/users/VanPaitin/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-17T13:39:53Z","updated_at":"2018-10-17T13:40:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"704f07e2385eb217c97f3b915a1a2ce56b28ae08","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/VanPaitin/Restorp/pulls/7/commits","review_comments_url":"https://api.github.com/repos/VanPaitin/Restorp/pulls/7/comments","review_comment_url":"https://api.github.com/repos/VanPaitin/Restorp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/VanPaitin/Restorp/issues/7/comments","statuses_url":"https://api.github.com/repos/VanPaitin/Restorp/statuses/2d9c3cf797a6dad11cd7c672d3e37c1671bc1632","head":{"label":"VanPaitin:mp-meals-endpoints","ref":"mp-meals-endpoints","sha":"2d9c3cf797a6dad11cd7c672d3e37c1671bc1632","user":{"login":"VanPaitin","id":14159416,"node_id":"MDQ6VXNlcjE0MTU5NDE2","avatar_url":"https://avatars1.githubusercontent.com/u/14159416?v=4","gravatar_id":"","url":"https://api.github.com/users/VanPaitin","html_url":"https://github.com/VanPaitin","followers_url":"https://api.github.com/users/VanPaitin/followers","following_url":"https://api.github.com/users/VanPaitin/following{/other_user}","gists_url":"https://api.github.com/users/VanPaitin/gists{/gist_id}","starred_url":"https://api.github.com/users/VanPaitin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VanPaitin/subscriptions","organizations_url":"https://api.github.com/users/VanPaitin/orgs","repos_url":"https://api.github.com/users/VanPaitin/repos","events_url":"https://api.github.com/users/VanPaitin/events{/privacy}","received_events_url":"https://api.github.com/users/VanPaitin/received_events","type":"User","site_admin":false},"repo":{"id":152285622,"node_id":"MDEwOlJlcG9zaXRvcnkxNTIyODU2MjI=","name":"Restorp","full_name":"VanPaitin/Restorp","private":false,"owner":{"login":"VanPaitin","id":14159416,"node_id":"MDQ6VXNlcjE0MTU5NDE2","avatar_url":"https://avatars1.githubusercontent.com/u/14159416?v=4","gravatar_id":"","url":"https://api.github.com/users/VanPaitin","html_url":"https://github.com/VanPaitin","followers_url":"https://api.github.com/users/VanPaitin/followers","following_url":"https://api.github.com/users/VanPaitin/following{/other_user}","gists_url":"https://api.github.com/users/VanPaitin/gists{/gist_id}","starred_url":"https://api.github.com/users/VanPaitin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VanPaitin/subscriptions","organizations_url":"https://api.github.com/users/VanPaitin/orgs","repos_url":"https://api.github.com/users/VanPaitin/repos","events_url":"https://api.github.com/users/VanPaitin/events{/privacy}","received_events_url":"https://api.github.com/users/VanPaitin/received_events","type":"User","site_admin":false},"html_url":"https://github.com/VanPaitin/Restorp","description":"An api where customers can query for restaurants and then order for food","fork":false,"url":"https://api.github.com/repos/VanPaitin/Restorp","forks_url":"https://api.github.com/repos/VanPaitin/Restorp/forks","keys_url":"https://api.github.com/repos/VanPaitin/Restorp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VanPaitin/Restorp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VanPaitin/Restorp/teams","hooks_url":"https://api.github.com/repos/VanPaitin/Restorp/hooks","issue_events_url":"https://api.github.com/repos/VanPaitin/Restorp/issues/events{/number}","events_url":"https://api.github.com/repos/VanPaitin/Restorp/events","assignees_url":"https://api.github.com/repos/VanPaitin/Restorp/assignees{/user}","branches_url":"https://api.github.com/repos/VanPaitin/Restorp/branches{/branch}","tags_url":"https://api.github.com/repos/VanPaitin/Restorp/tags","blobs_url":"https://api.github.com/repos/VanPaitin/Restorp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VanPaitin/Restorp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VanPaitin/Restorp/git/refs{/sha}","trees_url":"https://api.github.com/repos/VanPaitin/Restorp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VanPaitin/Restorp/statuses/{sha}","languages_url":"https://api.github.com/repos/VanPaitin/Restorp/languages","stargazers_url":"https://api.github.com/repos/VanPaitin/Restorp/stargazers","contributors_url":"https://api.github.com/repos/VanPaitin/Restorp/contributors","subscribers_url":"https://api.github.com/repos/VanPaitin/Restorp/subscribers","subscription_url":"https://api.github.com/repos/VanPaitin/Restorp/subscription","commits_url":"https://api.github.com/repos/VanPaitin/Restorp/commits{/sha}","git_commits_url":"https://api.github.com/repos/VanPaitin/Restorp/git/commits{/sha}","comments_url":"https://api.github.com/repos/VanPaitin/Restorp/comments{/number}","issue_comment_url":"https://api.github.com/repos/VanPaitin/Restorp/issues/comments{/number}","contents_url":"https://api.github.com/repos/VanPaitin/Restorp/contents/{+path}","compare_url":"https://api.github.com/repos/VanPaitin/Restorp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VanPaitin/Restorp/merges","archive_url":"https://api.github.com/repos/VanPaitin/Restorp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VanPaitin/Restorp/downloads","issues_url":"https://api.github.com/repos/VanPaitin/Restorp/issues{/number}","pulls_url":"https://api.github.com/repos/VanPaitin/Restorp/pulls{/number}","milestones_url":"https://api.github.com/repos/VanPaitin/Restorp/milestones{/number}","notifications_url":"https://api.github.com/repos/VanPaitin/Restorp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VanPaitin/Restorp/labels{/name}","releases_url":"https://api.github.com/repos/VanPaitin/Restorp/releases{/id}","deployments_url":"https://api.github.com/repos/VanPaitin/Restorp/deployments","created_at":"2018-10-09T16:36:13Z","updated_at":"2018-10-16T15:28:31Z","pushed_at":"2018-10-17T13:39:54Z","git_url":"git://github.com/VanPaitin/Restorp.git","ssh_url":"git@github.com:VanPaitin/Restorp.git","clone_url":"https://github.com/VanPaitin/Restorp.git","svn_url":"https://github.com/VanPaitin/Restorp","homepage":null,"size":125,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"VanPaitin:master","ref":"master","sha":"7ffa9285f897e083b11cfc6c6bb8fad51d63d123","user":{"login":"VanPaitin","id":14159416,"node_id":"MDQ6VXNlcjE0MTU5NDE2","avatar_url":"https://avatars1.githubusercontent.com/u/14159416?v=4","gravatar_id":"","url":"https://api.github.com/users/VanPaitin","html_url":"https://github.com/VanPaitin","followers_url":"https://api.github.com/users/VanPaitin/followers","following_url":"https://api.github.com/users/VanPaitin/following{/other_user}","gists_url":"https://api.github.com/users/VanPaitin/gists{/gist_id}","starred_url":"https://api.github.com/users/VanPaitin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VanPaitin/subscriptions","organizations_url":"https://api.github.com/users/VanPaitin/orgs","repos_url":"https://api.github.com/users/VanPaitin/repos","events_url":"https://api.github.com/users/VanPaitin/events{/privacy}","received_events_url":"https://api.github.com/users/VanPaitin/received_events","type":"User","site_admin":false},"repo":{"id":152285622,"node_id":"MDEwOlJlcG9zaXRvcnkxNTIyODU2MjI=","name":"Restorp","full_name":"VanPaitin/Restorp","private":false,"owner":{"login":"VanPaitin","id":14159416,"node_id":"MDQ6VXNlcjE0MTU5NDE2","avatar_url":"https://avatars1.githubusercontent.com/u/14159416?v=4","gravatar_id":"","url":"https://api.github.com/users/VanPaitin","html_url":"https://github.com/VanPaitin","followers_url":"https://api.github.com/users/VanPaitin/followers","following_url":"https://api.github.com/users/VanPaitin/following{/other_user}","gists_url":"https://api.github.com/users/VanPaitin/gists{/gist_id}","starred_url":"https://api.github.com/users/VanPaitin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VanPaitin/subscriptions","organizations_url":"https://api.github.com/users/VanPaitin/orgs","repos_url":"https://api.github.com/users/VanPaitin/repos","events_url":"https://api.github.com/users/VanPaitin/events{/privacy}","received_events_url":"https://api.github.com/users/VanPaitin/received_events","type":"User","site_admin":false},"html_url":"https://github.com/VanPaitin/Restorp","description":"An api where customers can query for restaurants and then order for food","fork":false,"url":"https://api.github.com/repos/VanPaitin/Restorp","forks_url":"https://api.github.com/repos/VanPaitin/Restorp/forks","keys_url":"https://api.github.com/repos/VanPaitin/Restorp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VanPaitin/Restorp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VanPaitin/Restorp/teams","hooks_url":"https://api.github.com/repos/VanPaitin/Restorp/hooks","issue_events_url":"https://api.github.com/repos/VanPaitin/Restorp/issues/events{/number}","events_url":"https://api.github.com/repos/VanPaitin/Restorp/events","assignees_url":"https://api.github.com/repos/VanPaitin/Restorp/assignees{/user}","branches_url":"https://api.github.com/repos/VanPaitin/Restorp/branches{/branch}","tags_url":"https://api.github.com/repos/VanPaitin/Restorp/tags","blobs_url":"https://api.github.com/repos/VanPaitin/Restorp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VanPaitin/Restorp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VanPaitin/Restorp/git/refs{/sha}","trees_url":"https://api.github.com/repos/VanPaitin/Restorp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VanPaitin/Restorp/statuses/{sha}","languages_url":"https://api.github.com/repos/VanPaitin/Restorp/languages","stargazers_url":"https://api.github.com/repos/VanPaitin/Restorp/stargazers","contributors_url":"https://api.github.com/repos/VanPaitin/Restorp/contributors","subscribers_url":"https://api.github.com/repos/VanPaitin/Restorp/subscribers","subscription_url":"https://api.github.com/repos/VanPaitin/Restorp/subscription","commits_url":"https://api.github.com/repos/VanPaitin/Restorp/commits{/sha}","git_commits_url":"https://api.github.com/repos/VanPaitin/Restorp/git/commits{/sha}","comments_url":"https://api.github.com/repos/VanPaitin/Restorp/comments{/number}","issue_comment_url":"https://api.github.com/repos/VanPaitin/Restorp/issues/comments{/number}","contents_url":"https://api.github.com/repos/VanPaitin/Restorp/contents/{+path}","compare_url":"https://api.github.com/repos/VanPaitin/Restorp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VanPaitin/Restorp/merges","archive_url":"https://api.github.com/repos/VanPaitin/Restorp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VanPaitin/Restorp/downloads","issues_url":"https://api.github.com/repos/VanPaitin/Restorp/issues{/number}","pulls_url":"https://api.github.com/repos/VanPaitin/Restorp/pulls{/number}","milestones_url":"https://api.github.com/repos/VanPaitin/Restorp/milestones{/number}","notifications_url":"https://api.github.com/repos/VanPaitin/Restorp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VanPaitin/Restorp/labels{/name}","releases_url":"https://api.github.com/repos/VanPaitin/Restorp/releases{/id}","deployments_url":"https://api.github.com/repos/VanPaitin/Restorp/deployments","created_at":"2018-10-09T16:36:13Z","updated_at":"2018-10-16T15:28:31Z","pushed_at":"2018-10-17T13:39:54Z","git_url":"git://github.com/VanPaitin/Restorp.git","ssh_url":"git@github.com:VanPaitin/Restorp.git","clone_url":"https://github.com/VanPaitin/Restorp.git","svn_url":"https://github.com/VanPaitin/Restorp","homepage":null,"size":125,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/VanPaitin/Restorp/pulls/7"},"html":{"href":"https://github.com/VanPaitin/Restorp/pull/7"},"issue":{"href":"https://api.github.com/repos/VanPaitin/Restorp/issues/7"},"comments":{"href":"https://api.github.com/repos/VanPaitin/Restorp/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/VanPaitin/Restorp/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/VanPaitin/Restorp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/VanPaitin/Restorp/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/VanPaitin/Restorp/statuses/2d9c3cf797a6dad11cd7c672d3e37c1671bc1632"}},"author_association":"OWNER"}}
{"actor":{"display_login":"houndci-bot"}}