{"action":"created","comment":{"url":"https://api.github.com/repos/missating/More-Recipes/pulls/comments/155997466","pull_request_review_id":82403383,"id":155997466,"diff_hunk":"@@ -0,0 +1,500 @@\n+import chaiHttp from 'chai-http';\n+import chai, { expect } from 'chai';\n+import app from '../app';\n+\n+chai.use(chaiHttp);\n+let user = {};\n+let recipe = {};\n+let review = {};\n+let user2;\n+let userToken;\n+let recipeId;\n+\n+\n+describe('API Endpoints testing', () => {\n+  describe('GET /', () => {\n+    it('Should return 200', (done) => {\n+      chai.request(app)\n+        .get('/')\n+        .end((err, res) => {\n+          expect(res).to.have.status(200);\n+          done();\n+        });\n+    });\n+    it('Should return 404 for unknown routes', (done) => {\n+      chai.request(app)\n+        .get('/this/is/an/unknown/route')\n+        .end((err, res) => {\n+          expect(res).to.have.status(404);\n+          done();\n+        });\n+    });\n+  });\n+\n+  describe('user signup', () => {\n+    const signupUrl = '/api/v1/users/signup';\n+    beforeEach(() => {\n+      user = {\n+        fullname: 'John Doe',\n+        username: 'jhonny',\n+        email: 'nessa@test.com',\n+        password: '1234567890',\n+        confirmPassword: '1234567890'\n+      };\n+    });\n+    it('Should register a new user', (done) => {\n+      chai.request(app)\n+        .post(signupUrl)\n+        .send(user)\n+        .end((err, res) => {\n+          expect(res.status).to.equal(201);\n+          done();\n+        });\n+    });\n+\n+\n+    it('Should register another new user', (done) => {\n+      user2 = Object.assign({}, user);\n+      user2.email = 'test5@test.com';\n+      chai.request(app)\n+        .post(signupUrl)\n+        .send(user2)\n+        .end((err, res) => {\n+          expect(res.status).to.equal(201);\n+          done();\n+        });\n+    });\n+\n+    it('Should return 403 for an already existing email.', (done) => {\n+      const sameData = Object.assign({}, user);\n+      sameData.fullname = 'Jane doe';\n+      chai.request(app)\n+        .post(signupUrl)\n+        .send(sameData)\n+        .end((err, res) => {\n+          expect(res.status).to.equal(403);\n+          done();\n+        });\n+    });\n+\n+    it('Should return 400 if no fullname is passed.', (done) => {\n+      const noFullname = Object.assign({}, user);\n+      delete noFullname.fullname;\n+      chai.request(app)\n+        .post(signupUrl)\n+        .send(noFullname)\n+        .end((err, res) => {\n+          expect(res.status).to.equal(400);\n+          done();\n+        });\n+    });\n+    it('return 400 for if password is less than 6 characters', (done) => {\n+      const sameData = Object.assign({}, user);\n+      sameData.password = '12345';\n+      chai.request(app)\n+        .post(signupUrl)\n+        .send(sameData)\n+        .end((err, res) => {\n+          expect(res.status).to.equal(400);\n+          done();\n+        });\n+    });\n+    it('Should return 400 if no password is passed', (done) => {\n+      const noPassword = Object.assign({}, user);\n+      delete noPassword.password;\n+      chai.request(app)\n+        .post(signupUrl)\n+        .send(noPassword)\n+        .end((err, res) => {\n+          expect(res.status).to.equal(400);\n+          done();\n+        });\n+    });\n+    it('Should return 400 for an incorrect email address', (done) => {\n+      const wrongEmail = Object.assign({}, user);\n+      wrongEmail.email = 'verywrongemailyahoo.com';\n+      chai.request(app).post(signupUrl)\n+        .send(wrongEmail)\n+        .end((err, res) => {\n+          expect(res.status).to.equal(400);\n+          done();\n+        });\n+    });\n+  });\n+\n+  describe('user signin', () => {\n+    const signinUrl = '/api/v1/users/signin';\n+\n+    beforeEach(() => {\n+      user = {\n+        email: 'nessa@test.com',\n+        password: '1234567890'\n+      };\n+    });\n+\n+    it('Should sign in a user', (done) => {","path":"server/test/controllersTest.js","position":135,"original_position":135,"commit_id":"93d79dd0bb7546d0b4cbcb94837230c0fe558131","original_commit_id":"93d79dd0bb7546d0b4cbcb94837230c0fe558131","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":"2017-12-11T07:23:46Z","updated_at":"2017-12-11T07:23:47Z","html_url":"https://github.com/missating/More-Recipes/pull/36#discussion_r155997466","pull_request_url":"https://api.github.com/repos/missating/More-Recipes/pulls/36","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/missating/More-Recipes/pulls/comments/155997466"},"html":{"href":"https://github.com/missating/More-Recipes/pull/36#discussion_r155997466"},"pull_request":{"href":"https://api.github.com/repos/missating/More-Recipes/pulls/36"}}},"pull_request":{"url":"https://api.github.com/repos/missating/More-Recipes/pulls/36","id":157493096,"html_url":"https://github.com/missating/More-Recipes/pull/36","diff_url":"https://github.com/missating/More-Recipes/pull/36.diff","patch_url":"https://github.com/missating/More-Recipes/pull/36.patch","issue_url":"https://api.github.com/repos/missating/More-Recipes/issues/36","number":36,"state":"open","locked":false,"title":"Ft user auth","user":{"login":"missating","id":29452947,"avatar_url":"https://avatars3.githubusercontent.com/u/29452947?v=4","gravatar_id":"","url":"https://api.github.com/users/missating","html_url":"https://github.com/missating","followers_url":"https://api.github.com/users/missating/followers","following_url":"https://api.github.com/users/missating/following{/other_user}","gists_url":"https://api.github.com/users/missating/gists{/gist_id}","starred_url":"https://api.github.com/users/missating/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/missating/subscriptions","organizations_url":"https://api.github.com/users/missating/orgs","repos_url":"https://api.github.com/users/missating/repos","events_url":"https://api.github.com/users/missating/events{/privacy}","received_events_url":"https://api.github.com/users/missating/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-12-11T07:23:36Z","updated_at":"2017-12-11T07:23:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3e0eecd7dcc651d7b628a227631ee2ac85a84622","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/missating/More-Recipes/pulls/36/commits","review_comments_url":"https://api.github.com/repos/missating/More-Recipes/pulls/36/comments","review_comment_url":"https://api.github.com/repos/missating/More-Recipes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/missating/More-Recipes/issues/36/comments","statuses_url":"https://api.github.com/repos/missating/More-Recipes/statuses/93d79dd0bb7546d0b4cbcb94837230c0fe558131","head":{"label":"missating:ft-user-auth","ref":"ft-user-auth","sha":"93d79dd0bb7546d0b4cbcb94837230c0fe558131","user":{"login":"missating","id":29452947,"avatar_url":"https://avatars3.githubusercontent.com/u/29452947?v=4","gravatar_id":"","url":"https://api.github.com/users/missating","html_url":"https://github.com/missating","followers_url":"https://api.github.com/users/missating/followers","following_url":"https://api.github.com/users/missating/following{/other_user}","gists_url":"https://api.github.com/users/missating/gists{/gist_id}","starred_url":"https://api.github.com/users/missating/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/missating/subscriptions","organizations_url":"https://api.github.com/users/missating/orgs","repos_url":"https://api.github.com/users/missating/repos","events_url":"https://api.github.com/users/missating/events{/privacy}","received_events_url":"https://api.github.com/users/missating/received_events","type":"User","site_admin":false},"repo":{"id":107739634,"name":"More-Recipes","full_name":"missating/More-Recipes","owner":{"login":"missating","id":29452947,"avatar_url":"https://avatars3.githubusercontent.com/u/29452947?v=4","gravatar_id":"","url":"https://api.github.com/users/missating","html_url":"https://github.com/missating","followers_url":"https://api.github.com/users/missating/followers","following_url":"https://api.github.com/users/missating/following{/other_user}","gists_url":"https://api.github.com/users/missating/gists{/gist_id}","starred_url":"https://api.github.com/users/missating/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/missating/subscriptions","organizations_url":"https://api.github.com/users/missating/orgs","repos_url":"https://api.github.com/users/missating/repos","events_url":"https://api.github.com/users/missating/events{/privacy}","received_events_url":"https://api.github.com/users/missating/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/missating/More-Recipes","description":"More-Recipes provides a platform for users to share awesome and exciting recipe ideas","fork":false,"url":"https://api.github.com/repos/missating/More-Recipes","forks_url":"https://api.github.com/repos/missating/More-Recipes/forks","keys_url":"https://api.github.com/repos/missating/More-Recipes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/missating/More-Recipes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/missating/More-Recipes/teams","hooks_url":"https://api.github.com/repos/missating/More-Recipes/hooks","issue_events_url":"https://api.github.com/repos/missating/More-Recipes/issues/events{/number}","events_url":"https://api.github.com/repos/missating/More-Recipes/events","assignees_url":"https://api.github.com/repos/missating/More-Recipes/assignees{/user}","branches_url":"https://api.github.com/repos/missating/More-Recipes/branches{/branch}","tags_url":"https://api.github.com/repos/missating/More-Recipes/tags","blobs_url":"https://api.github.com/repos/missating/More-Recipes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/missating/More-Recipes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/missating/More-Recipes/git/refs{/sha}","trees_url":"https://api.github.com/repos/missating/More-Recipes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/missating/More-Recipes/statuses/{sha}","languages_url":"https://api.github.com/repos/missating/More-Recipes/languages","stargazers_url":"https://api.github.com/repos/missating/More-Recipes/stargazers","contributors_url":"https://api.github.com/repos/missating/More-Recipes/contributors","subscribers_url":"https://api.github.com/repos/missating/More-Recipes/subscribers","subscription_url":"https://api.github.com/repos/missating/More-Recipes/subscription","commits_url":"https://api.github.com/repos/missating/More-Recipes/commits{/sha}","git_commits_url":"https://api.github.com/repos/missating/More-Recipes/git/commits{/sha}","comments_url":"https://api.github.com/repos/missating/More-Recipes/comments{/number}","issue_comment_url":"https://api.github.com/repos/missating/More-Recipes/issues/comments{/number}","contents_url":"https://api.github.com/repos/missating/More-Recipes/contents/{+path}","compare_url":"https://api.github.com/repos/missating/More-Recipes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/missating/More-Recipes/merges","archive_url":"https://api.github.com/repos/missating/More-Recipes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/missating/More-Recipes/downloads","issues_url":"https://api.github.com/repos/missating/More-Recipes/issues{/number}","pulls_url":"https://api.github.com/repos/missating/More-Recipes/pulls{/number}","milestones_url":"https://api.github.com/repos/missating/More-Recipes/milestones{/number}","notifications_url":"https://api.github.com/repos/missating/More-Recipes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/missating/More-Recipes/labels{/name}","releases_url":"https://api.github.com/repos/missating/More-Recipes/releases{/id}","deployments_url":"https://api.github.com/repos/missating/More-Recipes/deployments","created_at":"2017-10-21T00:43:24Z","updated_at":"2017-11-19T04:31:43Z","pushed_at":"2017-12-11T07:23:37Z","git_url":"git://github.com/missating/More-Recipes.git","ssh_url":"git@github.com:missating/More-Recipes.git","clone_url":"https://github.com/missating/More-Recipes.git","svn_url":"https://github.com/missating/More-Recipes","homepage":"https://missating.github.io/More-Recipes/template/index.html","size":3195,"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":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"missating:develop","ref":"develop","sha":"ecedfc67e56ebc052646b98eabb50db72704f124","user":{"login":"missating","id":29452947,"avatar_url":"https://avatars3.githubusercontent.com/u/29452947?v=4","gravatar_id":"","url":"https://api.github.com/users/missating","html_url":"https://github.com/missating","followers_url":"https://api.github.com/users/missating/followers","following_url":"https://api.github.com/users/missating/following{/other_user}","gists_url":"https://api.github.com/users/missating/gists{/gist_id}","starred_url":"https://api.github.com/users/missating/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/missating/subscriptions","organizations_url":"https://api.github.com/users/missating/orgs","repos_url":"https://api.github.com/users/missating/repos","events_url":"https://api.github.com/users/missating/events{/privacy}","received_events_url":"https://api.github.com/users/missating/received_events","type":"User","site_admin":false},"repo":{"id":107739634,"name":"More-Recipes","full_name":"missating/More-Recipes","owner":{"login":"missating","id":29452947,"avatar_url":"https://avatars3.githubusercontent.com/u/29452947?v=4","gravatar_id":"","url":"https://api.github.com/users/missating","html_url":"https://github.com/missating","followers_url":"https://api.github.com/users/missating/followers","following_url":"https://api.github.com/users/missating/following{/other_user}","gists_url":"https://api.github.com/users/missating/gists{/gist_id}","starred_url":"https://api.github.com/users/missating/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/missating/subscriptions","organizations_url":"https://api.github.com/users/missating/orgs","repos_url":"https://api.github.com/users/missating/repos","events_url":"https://api.github.com/users/missating/events{/privacy}","received_events_url":"https://api.github.com/users/missating/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/missating/More-Recipes","description":"More-Recipes provides a platform for users to share awesome and exciting recipe ideas","fork":false,"url":"https://api.github.com/repos/missating/More-Recipes","forks_url":"https://api.github.com/repos/missating/More-Recipes/forks","keys_url":"https://api.github.com/repos/missating/More-Recipes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/missating/More-Recipes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/missating/More-Recipes/teams","hooks_url":"https://api.github.com/repos/missating/More-Recipes/hooks","issue_events_url":"https://api.github.com/repos/missating/More-Recipes/issues/events{/number}","events_url":"https://api.github.com/repos/missating/More-Recipes/events","assignees_url":"https://api.github.com/repos/missating/More-Recipes/assignees{/user}","branches_url":"https://api.github.com/repos/missating/More-Recipes/branches{/branch}","tags_url":"https://api.github.com/repos/missating/More-Recipes/tags","blobs_url":"https://api.github.com/repos/missating/More-Recipes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/missating/More-Recipes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/missating/More-Recipes/git/refs{/sha}","trees_url":"https://api.github.com/repos/missating/More-Recipes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/missating/More-Recipes/statuses/{sha}","languages_url":"https://api.github.com/repos/missating/More-Recipes/languages","stargazers_url":"https://api.github.com/repos/missating/More-Recipes/stargazers","contributors_url":"https://api.github.com/repos/missating/More-Recipes/contributors","subscribers_url":"https://api.github.com/repos/missating/More-Recipes/subscribers","subscription_url":"https://api.github.com/repos/missating/More-Recipes/subscription","commits_url":"https://api.github.com/repos/missating/More-Recipes/commits{/sha}","git_commits_url":"https://api.github.com/repos/missating/More-Recipes/git/commits{/sha}","comments_url":"https://api.github.com/repos/missating/More-Recipes/comments{/number}","issue_comment_url":"https://api.github.com/repos/missating/More-Recipes/issues/comments{/number}","contents_url":"https://api.github.com/repos/missating/More-Recipes/contents/{+path}","compare_url":"https://api.github.com/repos/missating/More-Recipes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/missating/More-Recipes/merges","archive_url":"https://api.github.com/repos/missating/More-Recipes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/missating/More-Recipes/downloads","issues_url":"https://api.github.com/repos/missating/More-Recipes/issues{/number}","pulls_url":"https://api.github.com/repos/missating/More-Recipes/pulls{/number}","milestones_url":"https://api.github.com/repos/missating/More-Recipes/milestones{/number}","notifications_url":"https://api.github.com/repos/missating/More-Recipes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/missating/More-Recipes/labels{/name}","releases_url":"https://api.github.com/repos/missating/More-Recipes/releases{/id}","deployments_url":"https://api.github.com/repos/missating/More-Recipes/deployments","created_at":"2017-10-21T00:43:24Z","updated_at":"2017-11-19T04:31:43Z","pushed_at":"2017-12-11T07:23:37Z","git_url":"git://github.com/missating/More-Recipes.git","ssh_url":"git@github.com:missating/More-Recipes.git","clone_url":"https://github.com/missating/More-Recipes.git","svn_url":"https://github.com/missating/More-Recipes","homepage":"https://missating.github.io/More-Recipes/template/index.html","size":3195,"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":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/missating/More-Recipes/pulls/36"},"html":{"href":"https://github.com/missating/More-Recipes/pull/36"},"issue":{"href":"https://api.github.com/repos/missating/More-Recipes/issues/36"},"comments":{"href":"https://api.github.com/repos/missating/More-Recipes/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/missating/More-Recipes/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/missating/More-Recipes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/missating/More-Recipes/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/missating/More-Recipes/statuses/93d79dd0bb7546d0b4cbcb94837230c0fe558131"}},"author_association":"OWNER"}}
{"actor":{"display_login":"houndci-bot"}}