{"action":"created","comment":{"url":"https://api.github.com/repos/augustineezinwa/WEConnect/pulls/comments/175284443","pull_request_review_id":104792662,"id":175284443,"diff_hunk":"@@ -0,0 +1,192 @@\n+import chai from 'chai';\n+\n+import chaiHttp from 'chai-http';\n+\n+import app from '../app';\n+\n+import { businesses } from '../dummydb/db';\n+\n+const should = chai.should();\n+\n+chai.use(chaiHttp);\n+\n+process.env.NODE_ENV = 'test';\n+\n+describe('Testing /POST reviews', () => {\n+\n+  it('it should return an error message if a business doesnt exist', (done) => {\n+\n+    const review = {\n+\n+      reviewContent: 'i love this park',\n+\n+      userId: 34\n+\n+    };\n+\n+    chai.request(app).post('/api/v1/businesses/4/reviews')\n+\n+      .send(review).end((err, res) => {\n+\n+        res.should.be.status(404);\n+\n+        res.body.should.be.a('object');\n+\n+        res.body.should.have.property('message');\n+\n+        res.body.message.should.be.eql('Cannot add Review!, Business with businessId 4 does not exist');\n+\n+        done();\n+\n+      });\n+\n+  });\n+});\n+\n+describe('Testing /POST reviews', () => {\n+\n+  it('it should add reviews to a particular business by Id', (done) => {\n+\n+    const business1 = {\n+\n+      businessId: 3,\n+\n+      businessName: 'Virgin Austrailia',\n+\n+      businessAddress: 'No 10 New kingston road new zealand',\n+\n+      location: 'Austrailia',\n+\n+      category: 'Flight',\n+\n+      userId: 2,\n+\n+      reviews: []\n+\n+    };\n+\n+    businesses.push(business1);\n+\n+    const review = {\n+\n+      reviewContent: 'I love this place, its awesome!',\n+\n+      userId: 60,\n+\n+    };\n+\n+    chai.request(app).post('/api/v1/businesses/3/reviews')\n+\n+      .send(review).end((err, res) => {\n+\n+        res.should.have.status(201);\n+\n+        res.body.should.be.a('object');\n+\n+        res.body.should.have.property('message').eql('review was added successfully');\n+\n+        res.body.should.have.property('review');\n+\n+        res.body.review.should.have.property('reviewId').eql(1);\n+\n+        res.body.review.should.have.property('reviewContent').eql('I love this place, its awesome!');\n+\n+        res.body.review.should.have.property('userId').eql(60);\n+\n+        res.body.review.userId.should.be.a('number');\n+\n+        res.body.review.reviewContent.should.be.a('string');\n+\n+        res.body.review.reviewId.should.be.a('number');\n+\n+        res.body.message.should.be.a('string');\n+\n+        done();\n+\n+      });\n+\n+  });\n+});\n+\n+describe('Testing /GET reviews for a particular business', () => {\n+\n+  it('it should get all reviews attached to a particular business', (done) => {\n+\n+    chai.request(app).get('/api/v1/businesses/3/reviews')\n+\n+      .end((err, res) => {","path":"server/src/tests/ReviewControllerTest.js","position":117,"original_position":117,"commit_id":"a44fa08bdba7b2f353aa5591d765d71024dbc419","original_commit_id":"a44fa08bdba7b2f353aa5591d765d71024dbc419","user":{"login":"houndci-bot","id":6697940,"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":"'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').","created_at":"2018-03-18T10:41:45Z","updated_at":"2018-03-18T10:41:46Z","html_url":"https://github.com/augustineezinwa/WEConnect/pull/8#discussion_r175284443","pull_request_url":"https://api.github.com/repos/augustineezinwa/WEConnect/pulls/8","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/augustineezinwa/WEConnect/pulls/comments/175284443"},"html":{"href":"https://github.com/augustineezinwa/WEConnect/pull/8#discussion_r175284443"},"pull_request":{"href":"https://api.github.com/repos/augustineezinwa/WEConnect/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/augustineezinwa/WEConnect/pulls/8","id":175744720,"html_url":"https://github.com/augustineezinwa/WEConnect/pull/8","diff_url":"https://github.com/augustineezinwa/WEConnect/pull/8.diff","patch_url":"https://github.com/augustineezinwa/WEConnect/pull/8.patch","issue_url":"https://api.github.com/repos/augustineezinwa/WEConnect/issues/8","number":8,"state":"open","locked":false,"title":"Feature filterbycategory route #155587157","user":{"login":"augustineezinwa","id":30579559,"avatar_url":"https://avatars3.githubusercontent.com/u/30579559?v=4","gravatar_id":"","url":"https://api.github.com/users/augustineezinwa","html_url":"https://github.com/augustineezinwa","followers_url":"https://api.github.com/users/augustineezinwa/followers","following_url":"https://api.github.com/users/augustineezinwa/following{/other_user}","gists_url":"https://api.github.com/users/augustineezinwa/gists{/gist_id}","starred_url":"https://api.github.com/users/augustineezinwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/augustineezinwa/subscriptions","organizations_url":"https://api.github.com/users/augustineezinwa/orgs","repos_url":"https://api.github.com/users/augustineezinwa/repos","events_url":"https://api.github.com/users/augustineezinwa/events{/privacy}","received_events_url":"https://api.github.com/users/augustineezinwa/received_events","type":"User","site_admin":false},"body":"Hello, please i need review on my code. this code creates an API route that enables a user to filter search by category for businesses in the catalog. ","created_at":"2018-03-18T10:41:33Z","updated_at":"2018-03-18T10:41:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"30ad022d8b273af755c9d273b16b297e3f7eaa33","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/augustineezinwa/WEConnect/pulls/8/commits","review_comments_url":"https://api.github.com/repos/augustineezinwa/WEConnect/pulls/8/comments","review_comment_url":"https://api.github.com/repos/augustineezinwa/WEConnect/pulls/comments{/number}","comments_url":"https://api.github.com/repos/augustineezinwa/WEConnect/issues/8/comments","statuses_url":"https://api.github.com/repos/augustineezinwa/WEConnect/statuses/a44fa08bdba7b2f353aa5591d765d71024dbc419","head":{"label":"augustineezinwa:ft-filterbycategory-route-#155587157","ref":"ft-filterbycategory-route-#155587157","sha":"a44fa08bdba7b2f353aa5591d765d71024dbc419","user":{"login":"augustineezinwa","id":30579559,"avatar_url":"https://avatars3.githubusercontent.com/u/30579559?v=4","gravatar_id":"","url":"https://api.github.com/users/augustineezinwa","html_url":"https://github.com/augustineezinwa","followers_url":"https://api.github.com/users/augustineezinwa/followers","following_url":"https://api.github.com/users/augustineezinwa/following{/other_user}","gists_url":"https://api.github.com/users/augustineezinwa/gists{/gist_id}","starred_url":"https://api.github.com/users/augustineezinwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/augustineezinwa/subscriptions","organizations_url":"https://api.github.com/users/augustineezinwa/orgs","repos_url":"https://api.github.com/users/augustineezinwa/repos","events_url":"https://api.github.com/users/augustineezinwa/events{/privacy}","received_events_url":"https://api.github.com/users/augustineezinwa/received_events","type":"User","site_admin":false},"repo":{"id":123258104,"name":"WEConnect","full_name":"augustineezinwa/WEConnect","owner":{"login":"augustineezinwa","id":30579559,"avatar_url":"https://avatars3.githubusercontent.com/u/30579559?v=4","gravatar_id":"","url":"https://api.github.com/users/augustineezinwa","html_url":"https://github.com/augustineezinwa","followers_url":"https://api.github.com/users/augustineezinwa/followers","following_url":"https://api.github.com/users/augustineezinwa/following{/other_user}","gists_url":"https://api.github.com/users/augustineezinwa/gists{/gist_id}","starred_url":"https://api.github.com/users/augustineezinwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/augustineezinwa/subscriptions","organizations_url":"https://api.github.com/users/augustineezinwa/orgs","repos_url":"https://api.github.com/users/augustineezinwa/repos","events_url":"https://api.github.com/users/augustineezinwa/events{/privacy}","received_events_url":"https://api.github.com/users/augustineezinwa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/augustineezinwa/WEConnect","description":"WEConnect Application provides a platform that brings businesses and individuals together. ","fork":false,"url":"https://api.github.com/repos/augustineezinwa/WEConnect","forks_url":"https://api.github.com/repos/augustineezinwa/WEConnect/forks","keys_url":"https://api.github.com/repos/augustineezinwa/WEConnect/keys{/key_id}","collaborators_url":"https://api.github.com/repos/augustineezinwa/WEConnect/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/augustineezinwa/WEConnect/teams","hooks_url":"https://api.github.com/repos/augustineezinwa/WEConnect/hooks","issue_events_url":"https://api.github.com/repos/augustineezinwa/WEConnect/issues/events{/number}","events_url":"https://api.github.com/repos/augustineezinwa/WEConnect/events","assignees_url":"https://api.github.com/repos/augustineezinwa/WEConnect/assignees{/user}","branches_url":"https://api.github.com/repos/augustineezinwa/WEConnect/branches{/branch}","tags_url":"https://api.github.com/repos/augustineezinwa/WEConnect/tags","blobs_url":"https://api.github.com/repos/augustineezinwa/WEConnect/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/augustineezinwa/WEConnect/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/augustineezinwa/WEConnect/git/refs{/sha}","trees_url":"https://api.github.com/repos/augustineezinwa/WEConnect/git/trees{/sha}","statuses_url":"https://api.github.com/repos/augustineezinwa/WEConnect/statuses/{sha}","languages_url":"https://api.github.com/repos/augustineezinwa/WEConnect/languages","stargazers_url":"https://api.github.com/repos/augustineezinwa/WEConnect/stargazers","contributors_url":"https://api.github.com/repos/augustineezinwa/WEConnect/contributors","subscribers_url":"https://api.github.com/repos/augustineezinwa/WEConnect/subscribers","subscription_url":"https://api.github.com/repos/augustineezinwa/WEConnect/subscription","commits_url":"https://api.github.com/repos/augustineezinwa/WEConnect/commits{/sha}","git_commits_url":"https://api.github.com/repos/augustineezinwa/WEConnect/git/commits{/sha}","comments_url":"https://api.github.com/repos/augustineezinwa/WEConnect/comments{/number}","issue_comment_url":"https://api.github.com/repos/augustineezinwa/WEConnect/issues/comments{/number}","contents_url":"https://api.github.com/repos/augustineezinwa/WEConnect/contents/{+path}","compare_url":"https://api.github.com/repos/augustineezinwa/WEConnect/compare/{base}...{head}","merges_url":"https://api.github.com/repos/augustineezinwa/WEConnect/merges","archive_url":"https://api.github.com/repos/augustineezinwa/WEConnect/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/augustineezinwa/WEConnect/downloads","issues_url":"https://api.github.com/repos/augustineezinwa/WEConnect/issues{/number}","pulls_url":"https://api.github.com/repos/augustineezinwa/WEConnect/pulls{/number}","milestones_url":"https://api.github.com/repos/augustineezinwa/WEConnect/milestones{/number}","notifications_url":"https://api.github.com/repos/augustineezinwa/WEConnect/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/augustineezinwa/WEConnect/labels{/name}","releases_url":"https://api.github.com/repos/augustineezinwa/WEConnect/releases{/id}","deployments_url":"https://api.github.com/repos/augustineezinwa/WEConnect/deployments","created_at":"2018-02-28T08:59:44Z","updated_at":"2018-03-18T08:58:25Z","pushed_at":"2018-03-18T10:41:33Z","git_url":"git://github.com/augustineezinwa/WEConnect.git","ssh_url":"git@github.com:augustineezinwa/WEConnect.git","clone_url":"https://github.com/augustineezinwa/WEConnect.git","svn_url":"https://github.com/augustineezinwa/WEConnect","homepage":"","size":16094,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":8,"license":null,"forks":0,"open_issues":8,"watchers":0,"default_branch":"ft-signup-endpoint-#155587518"}},"base":{"label":"augustineezinwa:develop","ref":"develop","sha":"8049f0ae6c386c6620886f489d2071cdea120209","user":{"login":"augustineezinwa","id":30579559,"avatar_url":"https://avatars3.githubusercontent.com/u/30579559?v=4","gravatar_id":"","url":"https://api.github.com/users/augustineezinwa","html_url":"https://github.com/augustineezinwa","followers_url":"https://api.github.com/users/augustineezinwa/followers","following_url":"https://api.github.com/users/augustineezinwa/following{/other_user}","gists_url":"https://api.github.com/users/augustineezinwa/gists{/gist_id}","starred_url":"https://api.github.com/users/augustineezinwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/augustineezinwa/subscriptions","organizations_url":"https://api.github.com/users/augustineezinwa/orgs","repos_url":"https://api.github.com/users/augustineezinwa/repos","events_url":"https://api.github.com/users/augustineezinwa/events{/privacy}","received_events_url":"https://api.github.com/users/augustineezinwa/received_events","type":"User","site_admin":false},"repo":{"id":123258104,"name":"WEConnect","full_name":"augustineezinwa/WEConnect","owner":{"login":"augustineezinwa","id":30579559,"avatar_url":"https://avatars3.githubusercontent.com/u/30579559?v=4","gravatar_id":"","url":"https://api.github.com/users/augustineezinwa","html_url":"https://github.com/augustineezinwa","followers_url":"https://api.github.com/users/augustineezinwa/followers","following_url":"https://api.github.com/users/augustineezinwa/following{/other_user}","gists_url":"https://api.github.com/users/augustineezinwa/gists{/gist_id}","starred_url":"https://api.github.com/users/augustineezinwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/augustineezinwa/subscriptions","organizations_url":"https://api.github.com/users/augustineezinwa/orgs","repos_url":"https://api.github.com/users/augustineezinwa/repos","events_url":"https://api.github.com/users/augustineezinwa/events{/privacy}","received_events_url":"https://api.github.com/users/augustineezinwa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/augustineezinwa/WEConnect","description":"WEConnect Application provides a platform that brings businesses and individuals together. ","fork":false,"url":"https://api.github.com/repos/augustineezinwa/WEConnect","forks_url":"https://api.github.com/repos/augustineezinwa/WEConnect/forks","keys_url":"https://api.github.com/repos/augustineezinwa/WEConnect/keys{/key_id}","collaborators_url":"https://api.github.com/repos/augustineezinwa/WEConnect/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/augustineezinwa/WEConnect/teams","hooks_url":"https://api.github.com/repos/augustineezinwa/WEConnect/hooks","issue_events_url":"https://api.github.com/repos/augustineezinwa/WEConnect/issues/events{/number}","events_url":"https://api.github.com/repos/augustineezinwa/WEConnect/events","assignees_url":"https://api.github.com/repos/augustineezinwa/WEConnect/assignees{/user}","branches_url":"https://api.github.com/repos/augustineezinwa/WEConnect/branches{/branch}","tags_url":"https://api.github.com/repos/augustineezinwa/WEConnect/tags","blobs_url":"https://api.github.com/repos/augustineezinwa/WEConnect/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/augustineezinwa/WEConnect/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/augustineezinwa/WEConnect/git/refs{/sha}","trees_url":"https://api.github.com/repos/augustineezinwa/WEConnect/git/trees{/sha}","statuses_url":"https://api.github.com/repos/augustineezinwa/WEConnect/statuses/{sha}","languages_url":"https://api.github.com/repos/augustineezinwa/WEConnect/languages","stargazers_url":"https://api.github.com/repos/augustineezinwa/WEConnect/stargazers","contributors_url":"https://api.github.com/repos/augustineezinwa/WEConnect/contributors","subscribers_url":"https://api.github.com/repos/augustineezinwa/WEConnect/subscribers","subscription_url":"https://api.github.com/repos/augustineezinwa/WEConnect/subscription","commits_url":"https://api.github.com/repos/augustineezinwa/WEConnect/commits{/sha}","git_commits_url":"https://api.github.com/repos/augustineezinwa/WEConnect/git/commits{/sha}","comments_url":"https://api.github.com/repos/augustineezinwa/WEConnect/comments{/number}","issue_comment_url":"https://api.github.com/repos/augustineezinwa/WEConnect/issues/comments{/number}","contents_url":"https://api.github.com/repos/augustineezinwa/WEConnect/contents/{+path}","compare_url":"https://api.github.com/repos/augustineezinwa/WEConnect/compare/{base}...{head}","merges_url":"https://api.github.com/repos/augustineezinwa/WEConnect/merges","archive_url":"https://api.github.com/repos/augustineezinwa/WEConnect/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/augustineezinwa/WEConnect/downloads","issues_url":"https://api.github.com/repos/augustineezinwa/WEConnect/issues{/number}","pulls_url":"https://api.github.com/repos/augustineezinwa/WEConnect/pulls{/number}","milestones_url":"https://api.github.com/repos/augustineezinwa/WEConnect/milestones{/number}","notifications_url":"https://api.github.com/repos/augustineezinwa/WEConnect/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/augustineezinwa/WEConnect/labels{/name}","releases_url":"https://api.github.com/repos/augustineezinwa/WEConnect/releases{/id}","deployments_url":"https://api.github.com/repos/augustineezinwa/WEConnect/deployments","created_at":"2018-02-28T08:59:44Z","updated_at":"2018-03-18T08:58:25Z","pushed_at":"2018-03-18T10:41:33Z","git_url":"git://github.com/augustineezinwa/WEConnect.git","ssh_url":"git@github.com:augustineezinwa/WEConnect.git","clone_url":"https://github.com/augustineezinwa/WEConnect.git","svn_url":"https://github.com/augustineezinwa/WEConnect","homepage":"","size":16094,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":8,"license":null,"forks":0,"open_issues":8,"watchers":0,"default_branch":"ft-signup-endpoint-#155587518"}},"_links":{"self":{"href":"https://api.github.com/repos/augustineezinwa/WEConnect/pulls/8"},"html":{"href":"https://github.com/augustineezinwa/WEConnect/pull/8"},"issue":{"href":"https://api.github.com/repos/augustineezinwa/WEConnect/issues/8"},"comments":{"href":"https://api.github.com/repos/augustineezinwa/WEConnect/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/augustineezinwa/WEConnect/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/augustineezinwa/WEConnect/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/augustineezinwa/WEConnect/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/augustineezinwa/WEConnect/statuses/a44fa08bdba7b2f353aa5591d765d71024dbc419"}},"author_association":"OWNER"}}
{"actor":{"display_login":"houndci-bot"}}