{"action":"created","comment":{"url":"https://api.github.com/repos/ObieWalker/EventsManager/pulls/comments/188108409","pull_request_review_id":120021934,"id":188108409,"diff_hunk":"@@ -0,0 +1,201 @@\n+import chai from 'chai';\n+import chaiHttp from 'chai-http';\n+import app from '../app';\n+import helper from './testHelper';\n+\n+const { expect } = chai;\n+chai.use(chaiHttp);\n+chai.should();\n+\n+module.exports = describe('Tests for the user', () => {\n+  it('should return a status 400 error response for null first name', (done) => {\n+    chai\n+      .request(app)\n+      .post('/api/v1/users')\n+      .send({\n+        firstName: '',\n+        lastName: 'testln',\n+        username: 'testun',\n+        password: helper.userPassword,\n+        verifyPassword: helper.userPassword,\n+        email: helper.userEmail\n+      })\n+      .end((err, res) => {\n+        expect(res).to.be.status(400);\n+        res.body.should.have.a('object');\n+        res.body.error[0].should.have.property('msg').to.equal('Please enter your first name');\n+        done();\n+      });\n+  });\n+\n+  it('shoud return a status 400 error response for null last name', (done) => {\n+    chai\n+      .request(app)\n+      .post('/api/v1/users')\n+      .send({\n+        firstName: 'testfn',\n+        lastName: '',\n+        username: 'testun',\n+        password: helper.userPassword,\n+        verifyPassword: helper.userPassword,\n+        email: helper.userEmail\n+      })\n+      .end((err, res) => {\n+        expect(res).to.be.status(400);\n+        res.body.should.have.a('object');\n+        res.body.error[0].should.have.property('msg').to.equal('Please enter your last name');\n+        done();\n+      });\n+  });\n+\n+  it('shoud return a status 400 error response for null username', (done) => {\n+    chai\n+      .request(app)\n+      .post('/api/v1/users')\n+      .send({\n+        firstName: 'testfn',\n+        lastName: 'testln',\n+        username: '',\n+        password: helper.userPassword,\n+        verifyPassword: helper.userPassword,\n+        email: helper.userEmail\n+      })\n+      .end((err, res) => {\n+        expect(res).to.be.status(400);\n+        res.body.should.have.a('object');\n+        res.body.error[0].should.have.property('msg').to.equal('You have to enter a username');\n+        done();\n+      });\n+  });\n+\n+  it('shoud return a status 400 error response for null password', (done) => {\n+    chai\n+      .request(app)\n+      .post('/api/v1/users')\n+      .send({\n+        firstName: 'testfn',\n+        lastName: 'testln',\n+        username: 'testun',\n+        password: '',\n+        verifyPassword: helper.userPassword,\n+        email: helper.userEmail\n+      })\n+      .end((err, res) => {\n+        expect(res).to.be.status(400);\n+        res.body.should.have.a('object');\n+        res.body.error[0].should.have.property('msg').to.equal('You have to input a password please');\n+        done();\n+      });\n+  });\n+\n+  it('shoud return a status 400 error response for null password', (done) => {\n+    chai\n+      .request(app)\n+      .post('/api/v1/users')\n+      .send({\n+        firstName: 'testfn',\n+        lastName: 'testln',\n+        username: 'testun',\n+        password: helper.userPassword,\n+        verifyPassword: '',\n+        email: helper.userEmail\n+      })\n+      .end((err, res) => {\n+        expect(res).to.be.status(400);\n+        res.body.should.have.a('object');\n+        res.body.error[0].should.have.property('msg').to.equal('You have to verify your password');\n+        done();\n+      });\n+  });\n+\n+  it('shoud return a status 400 error response for no email input', (done) => {\n+    chai\n+      .request(app)\n+      .post('/api/v1/users')\n+      .send({\n+        firstName: 'testfn',\n+        lastName: 'testln',\n+        username: 'testun',\n+        password: helper.userPassword,\n+        verifyPassword: helper.userPassword,\n+        email: ''\n+      })\n+      .end((err, res) => {\n+        expect(res).to.be.status(400);\n+        res.body.should.have.a('object');\n+        res.body.error[0].should.have.property('msg').to.equal('You did not enter a valid email');\n+        done();\n+      });\n+  });\n+\n+  it('shoud return a status 201 response for new user', (done) => {\n+    chai\n+      .request(app)\n+      .post('/api/v1/users')\n+      .send({\n+        firstName: 'testfn',\n+        lastName: 'testln',\n+        username: 'testun',\n+        password: helper.userPassword,\n+        verifyPassword: helper.userPassword,\n+        email: helper.userEmail\n+      })\n+      .end((err, res) => {\n+        expect(res).to.be.status(201);\n+        res.body.should.have.a('object');\n+        res.body.should.have.property('message').to.equal('Your account has been created!, Your details');\n+        done();\n+      });\n+  });\n+\n+  it('shoud return a status 400 response the email already existing', (done) => {\n+    chai\n+      .request(app)\n+      .post('/api/v1/users')\n+      .send({\n+        firstName: 'testfn1',\n+        lastName: 'testln',\n+        username: 'testun',\n+        password: helper.userPassword,\n+        verifyPassword: helper.userPassword,\n+        email: helper.userEmail\n+      })\n+      .end((err, res) => {\n+        expect(res).to.be.status(400);\n+        res.body.should.have.a('object');\n+        res.body.should.have.property('message').to.equal('User already exists');\n+        done();\n+      });\n+  });\n+\n+  it('shoud return a status 200 response for successful sign in as admin', (done) => {\n+    chai\n+      .request(app)\n+      .post('/api/v1/users/login')\n+      .send({\n+        email: helper.adminEmail,\n+        password: helper.adminPassword\n+      })\n+      .end((err, res) => {\n+        helper.setAdminToken(res.body.token);\n+        done();\n+      });\n+  });\n+\n+  it('shoud return a status 200 response for successful sign in as user', (done) => {","path":"server/tests/users.js","position":185,"original_position":185,"commit_id":"9a2dc2782fd51b429853a9db0a1a21f27d15f92c","original_commit_id":"9a2dc2782fd51b429853a9db0a1a21f27d15f92c","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-05-14T21:45:41Z","updated_at":"2018-05-14T21:45:42Z","html_url":"https://github.com/ObieWalker/EventsManager/pull/24#discussion_r188108409","pull_request_url":"https://api.github.com/repos/ObieWalker/EventsManager/pulls/24","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/ObieWalker/EventsManager/pulls/comments/188108409"},"html":{"href":"https://github.com/ObieWalker/EventsManager/pull/24#discussion_r188108409"},"pull_request":{"href":"https://api.github.com/repos/ObieWalker/EventsManager/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/ObieWalker/EventsManager/pulls/24","id":184848282,"html_url":"https://github.com/ObieWalker/EventsManager/pull/24","diff_url":"https://github.com/ObieWalker/EventsManager/pull/24.diff","patch_url":"https://github.com/ObieWalker/EventsManager/pull/24.patch","issue_url":"https://api.github.com/repos/ObieWalker/EventsManager/issues/24","number":24,"state":"open","locked":false,"title":"ch(test coverage): improve test coverage","user":{"login":"ObieWalker","id":8572766,"avatar_url":"https://avatars1.githubusercontent.com/u/8572766?v=4","gravatar_id":"","url":"https://api.github.com/users/ObieWalker","html_url":"https://github.com/ObieWalker","followers_url":"https://api.github.com/users/ObieWalker/followers","following_url":"https://api.github.com/users/ObieWalker/following{/other_user}","gists_url":"https://api.github.com/users/ObieWalker/gists{/gist_id}","starred_url":"https://api.github.com/users/ObieWalker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ObieWalker/subscriptions","organizations_url":"https://api.github.com/users/ObieWalker/orgs","repos_url":"https://api.github.com/users/ObieWalker/repos","events_url":"https://api.github.com/users/ObieWalker/events{/privacy}","received_events_url":"https://api.github.com/users/ObieWalker/received_events","type":"User","site_admin":false},"body":"What does this PR do?\r\nThis PR improves my test coverage for the backend of this application.\r\n\r\nDescription of Task to be completed?\r\n- get test coverage above 80%\r\n- implement edge cases\r\n- fix pit falls arising from tests\r\n\r\nHow should this be manually tested?\r\n* clone the repo and change into the project directory\r\n* run npm install to install required packages\r\n* create a .env file and add all the required environment variables\r\n* start up the server with the command npm run test:dev\r\n\r\nAny background context you want to provide?\r\nN/A\r\nWhat are the relevant pivotal tracker stories?(if applicable)\r\n#157116352\r\n","created_at":"2018-04-29T18:43:42Z","updated_at":"2018-05-14T21:45:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7dbab37b05aa7e0ccdec0866c76598a26aa19dd2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ObieWalker/EventsManager/pulls/24/commits","review_comments_url":"https://api.github.com/repos/ObieWalker/EventsManager/pulls/24/comments","review_comment_url":"https://api.github.com/repos/ObieWalker/EventsManager/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ObieWalker/EventsManager/issues/24/comments","statuses_url":"https://api.github.com/repos/ObieWalker/EventsManager/statuses/9a2dc2782fd51b429853a9db0a1a21f27d15f92c","head":{"label":"ObieWalker:ch-tests-coverage","ref":"ch-tests-coverage","sha":"9a2dc2782fd51b429853a9db0a1a21f27d15f92c","user":{"login":"ObieWalker","id":8572766,"avatar_url":"https://avatars1.githubusercontent.com/u/8572766?v=4","gravatar_id":"","url":"https://api.github.com/users/ObieWalker","html_url":"https://github.com/ObieWalker","followers_url":"https://api.github.com/users/ObieWalker/followers","following_url":"https://api.github.com/users/ObieWalker/following{/other_user}","gists_url":"https://api.github.com/users/ObieWalker/gists{/gist_id}","starred_url":"https://api.github.com/users/ObieWalker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ObieWalker/subscriptions","organizations_url":"https://api.github.com/users/ObieWalker/orgs","repos_url":"https://api.github.com/users/ObieWalker/repos","events_url":"https://api.github.com/users/ObieWalker/events{/privacy}","received_events_url":"https://api.github.com/users/ObieWalker/received_events","type":"User","site_admin":false},"repo":{"id":110956553,"name":"EventsManager","full_name":"ObieWalker/EventsManager","owner":{"login":"ObieWalker","id":8572766,"avatar_url":"https://avatars1.githubusercontent.com/u/8572766?v=4","gravatar_id":"","url":"https://api.github.com/users/ObieWalker","html_url":"https://github.com/ObieWalker","followers_url":"https://api.github.com/users/ObieWalker/followers","following_url":"https://api.github.com/users/ObieWalker/following{/other_user}","gists_url":"https://api.github.com/users/ObieWalker/gists{/gist_id}","starred_url":"https://api.github.com/users/ObieWalker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ObieWalker/subscriptions","organizations_url":"https://api.github.com/users/ObieWalker/orgs","repos_url":"https://api.github.com/users/ObieWalker/repos","events_url":"https://api.github.com/users/ObieWalker/events{/privacy}","received_events_url":"https://api.github.com/users/ObieWalker/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ObieWalker/EventsManager","description":null,"fork":false,"url":"https://api.github.com/repos/ObieWalker/EventsManager","forks_url":"https://api.github.com/repos/ObieWalker/EventsManager/forks","keys_url":"https://api.github.com/repos/ObieWalker/EventsManager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ObieWalker/EventsManager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ObieWalker/EventsManager/teams","hooks_url":"https://api.github.com/repos/ObieWalker/EventsManager/hooks","issue_events_url":"https://api.github.com/repos/ObieWalker/EventsManager/issues/events{/number}","events_url":"https://api.github.com/repos/ObieWalker/EventsManager/events","assignees_url":"https://api.github.com/repos/ObieWalker/EventsManager/assignees{/user}","branches_url":"https://api.github.com/repos/ObieWalker/EventsManager/branches{/branch}","tags_url":"https://api.github.com/repos/ObieWalker/EventsManager/tags","blobs_url":"https://api.github.com/repos/ObieWalker/EventsManager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ObieWalker/EventsManager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ObieWalker/EventsManager/git/refs{/sha}","trees_url":"https://api.github.com/repos/ObieWalker/EventsManager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ObieWalker/EventsManager/statuses/{sha}","languages_url":"https://api.github.com/repos/ObieWalker/EventsManager/languages","stargazers_url":"https://api.github.com/repos/ObieWalker/EventsManager/stargazers","contributors_url":"https://api.github.com/repos/ObieWalker/EventsManager/contributors","subscribers_url":"https://api.github.com/repos/ObieWalker/EventsManager/subscribers","subscription_url":"https://api.github.com/repos/ObieWalker/EventsManager/subscription","commits_url":"https://api.github.com/repos/ObieWalker/EventsManager/commits{/sha}","git_commits_url":"https://api.github.com/repos/ObieWalker/EventsManager/git/commits{/sha}","comments_url":"https://api.github.com/repos/ObieWalker/EventsManager/comments{/number}","issue_comment_url":"https://api.github.com/repos/ObieWalker/EventsManager/issues/comments{/number}","contents_url":"https://api.github.com/repos/ObieWalker/EventsManager/contents/{+path}","compare_url":"https://api.github.com/repos/ObieWalker/EventsManager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ObieWalker/EventsManager/merges","archive_url":"https://api.github.com/repos/ObieWalker/EventsManager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ObieWalker/EventsManager/downloads","issues_url":"https://api.github.com/repos/ObieWalker/EventsManager/issues{/number}","pulls_url":"https://api.github.com/repos/ObieWalker/EventsManager/pulls{/number}","milestones_url":"https://api.github.com/repos/ObieWalker/EventsManager/milestones{/number}","notifications_url":"https://api.github.com/repos/ObieWalker/EventsManager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ObieWalker/EventsManager/labels{/name}","releases_url":"https://api.github.com/repos/ObieWalker/EventsManager/releases{/id}","deployments_url":"https://api.github.com/repos/ObieWalker/EventsManager/deployments","created_at":"2017-11-16T10:17:41Z","updated_at":"2018-05-13T22:31:38Z","pushed_at":"2018-05-14T21:45:22Z","git_url":"git://github.com/ObieWalker/EventsManager.git","ssh_url":"git@github.com:ObieWalker/EventsManager.git","clone_url":"https://github.com/ObieWalker/EventsManager.git","svn_url":"https://github.com/ObieWalker/EventsManager","homepage":null,"size":6384,"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":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"ObieWalker:develop","ref":"develop","sha":"898099f32b331d9898cbb8416107dbecb061b738","user":{"login":"ObieWalker","id":8572766,"avatar_url":"https://avatars1.githubusercontent.com/u/8572766?v=4","gravatar_id":"","url":"https://api.github.com/users/ObieWalker","html_url":"https://github.com/ObieWalker","followers_url":"https://api.github.com/users/ObieWalker/followers","following_url":"https://api.github.com/users/ObieWalker/following{/other_user}","gists_url":"https://api.github.com/users/ObieWalker/gists{/gist_id}","starred_url":"https://api.github.com/users/ObieWalker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ObieWalker/subscriptions","organizations_url":"https://api.github.com/users/ObieWalker/orgs","repos_url":"https://api.github.com/users/ObieWalker/repos","events_url":"https://api.github.com/users/ObieWalker/events{/privacy}","received_events_url":"https://api.github.com/users/ObieWalker/received_events","type":"User","site_admin":false},"repo":{"id":110956553,"name":"EventsManager","full_name":"ObieWalker/EventsManager","owner":{"login":"ObieWalker","id":8572766,"avatar_url":"https://avatars1.githubusercontent.com/u/8572766?v=4","gravatar_id":"","url":"https://api.github.com/users/ObieWalker","html_url":"https://github.com/ObieWalker","followers_url":"https://api.github.com/users/ObieWalker/followers","following_url":"https://api.github.com/users/ObieWalker/following{/other_user}","gists_url":"https://api.github.com/users/ObieWalker/gists{/gist_id}","starred_url":"https://api.github.com/users/ObieWalker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ObieWalker/subscriptions","organizations_url":"https://api.github.com/users/ObieWalker/orgs","repos_url":"https://api.github.com/users/ObieWalker/repos","events_url":"https://api.github.com/users/ObieWalker/events{/privacy}","received_events_url":"https://api.github.com/users/ObieWalker/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ObieWalker/EventsManager","description":null,"fork":false,"url":"https://api.github.com/repos/ObieWalker/EventsManager","forks_url":"https://api.github.com/repos/ObieWalker/EventsManager/forks","keys_url":"https://api.github.com/repos/ObieWalker/EventsManager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ObieWalker/EventsManager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ObieWalker/EventsManager/teams","hooks_url":"https://api.github.com/repos/ObieWalker/EventsManager/hooks","issue_events_url":"https://api.github.com/repos/ObieWalker/EventsManager/issues/events{/number}","events_url":"https://api.github.com/repos/ObieWalker/EventsManager/events","assignees_url":"https://api.github.com/repos/ObieWalker/EventsManager/assignees{/user}","branches_url":"https://api.github.com/repos/ObieWalker/EventsManager/branches{/branch}","tags_url":"https://api.github.com/repos/ObieWalker/EventsManager/tags","blobs_url":"https://api.github.com/repos/ObieWalker/EventsManager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ObieWalker/EventsManager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ObieWalker/EventsManager/git/refs{/sha}","trees_url":"https://api.github.com/repos/ObieWalker/EventsManager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ObieWalker/EventsManager/statuses/{sha}","languages_url":"https://api.github.com/repos/ObieWalker/EventsManager/languages","stargazers_url":"https://api.github.com/repos/ObieWalker/EventsManager/stargazers","contributors_url":"https://api.github.com/repos/ObieWalker/EventsManager/contributors","subscribers_url":"https://api.github.com/repos/ObieWalker/EventsManager/subscribers","subscription_url":"https://api.github.com/repos/ObieWalker/EventsManager/subscription","commits_url":"https://api.github.com/repos/ObieWalker/EventsManager/commits{/sha}","git_commits_url":"https://api.github.com/repos/ObieWalker/EventsManager/git/commits{/sha}","comments_url":"https://api.github.com/repos/ObieWalker/EventsManager/comments{/number}","issue_comment_url":"https://api.github.com/repos/ObieWalker/EventsManager/issues/comments{/number}","contents_url":"https://api.github.com/repos/ObieWalker/EventsManager/contents/{+path}","compare_url":"https://api.github.com/repos/ObieWalker/EventsManager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ObieWalker/EventsManager/merges","archive_url":"https://api.github.com/repos/ObieWalker/EventsManager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ObieWalker/EventsManager/downloads","issues_url":"https://api.github.com/repos/ObieWalker/EventsManager/issues{/number}","pulls_url":"https://api.github.com/repos/ObieWalker/EventsManager/pulls{/number}","milestones_url":"https://api.github.com/repos/ObieWalker/EventsManager/milestones{/number}","notifications_url":"https://api.github.com/repos/ObieWalker/EventsManager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ObieWalker/EventsManager/labels{/name}","releases_url":"https://api.github.com/repos/ObieWalker/EventsManager/releases{/id}","deployments_url":"https://api.github.com/repos/ObieWalker/EventsManager/deployments","created_at":"2017-11-16T10:17:41Z","updated_at":"2018-05-13T22:31:38Z","pushed_at":"2018-05-14T21:45:22Z","git_url":"git://github.com/ObieWalker/EventsManager.git","ssh_url":"git@github.com:ObieWalker/EventsManager.git","clone_url":"https://github.com/ObieWalker/EventsManager.git","svn_url":"https://github.com/ObieWalker/EventsManager","homepage":null,"size":6384,"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":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ObieWalker/EventsManager/pulls/24"},"html":{"href":"https://github.com/ObieWalker/EventsManager/pull/24"},"issue":{"href":"https://api.github.com/repos/ObieWalker/EventsManager/issues/24"},"comments":{"href":"https://api.github.com/repos/ObieWalker/EventsManager/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/ObieWalker/EventsManager/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/ObieWalker/EventsManager/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ObieWalker/EventsManager/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/ObieWalker/EventsManager/statuses/9a2dc2782fd51b429853a9db0a1a21f27d15f92c"}},"author_association":"OWNER"}}
{"actor":{"display_login":"houndci-bot"}}