{"action":"created","comment":{"url":"https://api.github.com/repos/augustineezinwa/WEConnect/pulls/comments/175286246","pull_request_review_id":104794420,"id":175286246,"diff_hunk":"@@ -0,0 +1,314 @@\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+\n+describe('Testing /GET businesses', () => {\n+\n+  it('it should GET all business in the array', (done) => {\n+\n+    chai.request(app).get('/api/v1/businesses')\n+\n+      .end((err, res) => {\n+\n+        res.should.have.status(200);\n+\n+        res.body.should.be.a('object');\n+\n+        res.body.should.have.property('message').eql('business list loaded successfully');\n+\n+        res.body.should.have.property('businesses');\n+\n+        res.body.businesses.should.be.a('array');\n+\n+        res.body.businesses.length.should.be.eql(1);\n+\n+        res.body.businesses[0].should.have.property('businessId').eql(3);\n+\n+        res.body.businesses[0].should.have.property('businessName').eql('Shoprite');\n+\n+        res.body.businesses[0].should.have.property('businessAddress').eql('no 5 washington road');\n+\n+        res.body.businesses[0].should.have.property('location').eql('USA');\n+\n+        res.body.businesses[0].should.have.property('category').eql('supermarket');\n+\n+        res.body.businesses[0].should.have.property('userId').eql(1);\n+\n+        res.body.businesses[0].businessId.should.be.a('number');\n+\n+        res.body.businesses[0].businessName.should.be.a('string');\n+\n+        res.body.businesses[0].businessAddress.should.be.a('string');\n+\n+        res.body.businesses[0].location.should.be.a('string');\n+\n+        res.body.businesses[0].category.should.be.a('string');\n+\n+        res.body.businesses[0].userId.should.be.a('number');\n+\n+        done();\n+\n+      });\n+\n+  });\n+\n+});\n+\n+describe('Testing /GET businesses/:businessId', () => {\n+\n+  it('it should GET all business in the array', (done) => {\n+\n+    chai.request(app).get('/api/v1/businesses/3')\n+\n+      .end((err, res) => {\n+\n+        res.should.have.status(200);\n+\n+        res.body.should.be.a('object');\n+\n+        res.body.should.have.property('message').eql('business search was successful');\n+\n+        res.body.should.have.property('businesses');\n+\n+        res.body.businesses.should.be.a('array');\n+\n+        res.body.businesses.length.should.be.eql(1);\n+\n+        res.body.businesses[0].should.have.property('businessId').eql(3);\n+\n+        res.body.businesses[0].should.have.property('businessName').eql('Shoprite');\n+\n+        res.body.businesses[0].should.have.property('businessAddress').eql('no 5 washington road');\n+\n+        res.body.businesses[0].should.have.property('location').eql('USA');\n+\n+        res.body.businesses[0].should.have.property('category').eql('supermarket');\n+\n+        res.body.businesses[0].should.have.property('userId').eql(1);\n+\n+        res.body.businesses[0].businessId.should.be.a('number');\n+\n+        res.body.businesses[0].businessName.should.be.a('string');\n+\n+        res.body.businesses[0].businessAddress.should.be.a('string');\n+\n+        res.body.businesses[0].location.should.be.a('string');\n+\n+        res.body.businesses[0].category.should.be.a('string');\n+\n+        res.body.businesses[0].userId.should.be.a('number');\n+\n+        done();\n+\n+      });\n+\n+  });\n+\n+});\n+\n+describe('Testing /POST businesses', () => {\n+\n+\n+  const business1 = {\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+  it('it should post a particular business into database', (done) => {\n+\n+    chai.request(app).post('/api/v1/businesses/')\n+\n+      .send(business1).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('business successfully added');\n+\n+        res.body.newBusiness.should.have.property('businessName').eql('Virgin Austrailia');\n+\n+        res.body.newBusiness.should.have.property('businessAddress').eql('No 10 New kingston road new zealand');\n+\n+        res.body.newBusiness.should.have.property('location').eql('Austrailia');\n+\n+        res.body.newBusiness.should.have.property('category').eql('Flight');\n+\n+        res.body.message.should.be.a('string');\n+\n+        res.body.newBusiness.businessName.should.be.a('string');\n+\n+        res.body.newBusiness.businessAddress.should.be.a('string');\n+\n+        res.body.newBusiness.location.should.be.a('string');\n+\n+        res.body.newBusiness.category.should.be.a('string');\n+\n+        businesses.length.should.be.eql(2);\n+\n+        businesses[1].category.should.be.eql('Flight');\n+\n+        businesses[1].location.should.be.eql('Austrailia');\n+\n+        businesses[1].businessId.should.be.eql(4);\n+\n+        businesses[1].businessName.should.be.eql('Virgin Austrailia');\n+\n+        businesses[1].businessAddress.should.be.eql('No 10 New kingston road new zealand');\n+\n+\n+        done();\n+\n+      });\n+  });\n+});\n+\n+describe('Testing API endpoints', () => {\n+\n+  beforeEach((done) => {\n+\n+    businesses.splice(0, businesses.length);\n+    done();\n+\n+  });\n+\n+  describe('Testing /GET businesses', () => {","path":"server/src/tests/BusinessControllerTest.js","position":197,"original_position":197,"commit_id":"4f6a65df8214ff8d56bec72282a2df1fa5b7268b","original_commit_id":"4f6a65df8214ff8d56bec72282a2df1fa5b7268b","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-18T11:52:26Z","updated_at":"2018-03-18T11:52:27Z","html_url":"https://github.com/augustineezinwa/WEConnect/pull/14#discussion_r175286246","pull_request_url":"https://api.github.com/repos/augustineezinwa/WEConnect/pulls/14","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/augustineezinwa/WEConnect/pulls/comments/175286246"},"html":{"href":"https://github.com/augustineezinwa/WEConnect/pull/14#discussion_r175286246"},"pull_request":{"href":"https://api.github.com/repos/augustineezinwa/WEConnect/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/augustineezinwa/WEConnect/pulls/14","id":175747209,"html_url":"https://github.com/augustineezinwa/WEConnect/pull/14","diff_url":"https://github.com/augustineezinwa/WEConnect/pull/14.diff","patch_url":"https://github.com/augustineezinwa/WEConnect/pull/14.patch","issue_url":"https://api.github.com/repos/augustineezinwa/WEConnect/issues/14","number":14,"state":"open","locked":false,"title":"Feature- register business route #155584880","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, this code creates an API endpoint enables user to register a business into WEConnect application. Please i need your reviews on this code base. I am open to feedback and your contributions \r\n","created_at":"2018-03-18T11:52:14Z","updated_at":"2018-03-18T11:52:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"486ec59edc2c6fc6fe38c26bc576ef8a6c5a167f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/augustineezinwa/WEConnect/pulls/14/commits","review_comments_url":"https://api.github.com/repos/augustineezinwa/WEConnect/pulls/14/comments","review_comment_url":"https://api.github.com/repos/augustineezinwa/WEConnect/pulls/comments{/number}","comments_url":"https://api.github.com/repos/augustineezinwa/WEConnect/issues/14/comments","statuses_url":"https://api.github.com/repos/augustineezinwa/WEConnect/statuses/4f6a65df8214ff8d56bec72282a2df1fa5b7268b","head":{"label":"augustineezinwa:ft-register-business-route-#155584880","ref":"ft-register-business-route-#155584880","sha":"4f6a65df8214ff8d56bec72282a2df1fa5b7268b","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-18T11:52:14Z","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":14,"license":null,"forks":0,"open_issues":14,"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-18T11:52:14Z","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":14,"license":null,"forks":0,"open_issues":14,"watchers":0,"default_branch":"ft-signup-endpoint-#155587518"}},"_links":{"self":{"href":"https://api.github.com/repos/augustineezinwa/WEConnect/pulls/14"},"html":{"href":"https://github.com/augustineezinwa/WEConnect/pull/14"},"issue":{"href":"https://api.github.com/repos/augustineezinwa/WEConnect/issues/14"},"comments":{"href":"https://api.github.com/repos/augustineezinwa/WEConnect/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/augustineezinwa/WEConnect/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/augustineezinwa/WEConnect/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/augustineezinwa/WEConnect/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/augustineezinwa/WEConnect/statuses/4f6a65df8214ff8d56bec72282a2df1fa5b7268b"}},"author_association":"OWNER"}}
{"actor":{"display_login":"houndci-bot"}}