{"action":"created","comment":{"url":"https://api.github.com/repos/andela-stuff/andela-teams-core/pulls/comments/169116127","pull_request_review_id":97590895,"id":169116127,"diff_hunk":"@@ -0,0 +1,135 @@\n+/**\n+ * @fileOverview Auth controller tests\n+ *\n+ * @author Franklin Chieze\n+ *\n+ * @requires NPM:bcrypt\n+ * @requires NPM:chai\n+ * @requires NPM:chai-http\n+ * @requires ../mock\n+ * @requires ../../build/models\n+ * @requires ../../build/server\n+ */\n+\n+import bcrypt from 'bcrypt';\n+import chai from 'chai';\n+import chaiHttp from 'chai-http';\n+\n+import mock from '../mock';\n+import models from '../../build/models';\n+import server from '../../build/server';\n+\n+const should = chai.should();\n+const { expect } = chai;\n+chai.use(chaiHttp);\n+\n+// should not register user without email\n+// should not register user with name\n+// should not register user without password\n+// should not sign in user with invalid credentials\n+\n+describe('AuthController', () => {\n+  beforeEach(async () => {\n+    await models.User.destroy({ where: {} });\n+  });\n+  describe('POST: /v1/auth/signin', (done) => {\n+    beforeEach(async () => {\n+      await models.User.create({\n+        name: mock.user1.name,\n+        email: mock.user1.email,\n+        password: await bcrypt.hash(mock.user1.password, 1)\n+      });\n+    });\n+    it('should return a user token on successful sign in', (done) => {\n+      chai.request(server)\n+        .post('/v1/auth/signin')\n+        .send(mock.user1)\n+        .end((err, res) => {\n+          res.should.have.status(200);\n+          res.body.should.have.property('data');\n+          expect(res.body.data).to.be.an('Object');\n+          res.body.data.should.have.property('user');\n+          expect(res.body.data.user.id).to.not.be.undefined;\n+          expect(res.body.data.user.name).to.equal(mock.user1.name);\n+          expect(res.body.data.user.email).to.equal(mock.user1.email);\n+          res.body.data.user.should.not.have.property('password');\n+          res.body.data.should.have.property('userToken');\n+          expect(res.body.errors).to.be.undefined;\n+          done();\n+        });\n+    });\n+    it('should not sign in user without email', (done) => {\n+      chai.request(server)\n+        .post('/v1/auth/signin')\n+        .send({\n+          password: mock.user1.password\n+        })\n+        .end((err, res) => {\n+          res.should.have.status(200);\n+          res.body.should.have.property('errors');\n+          expect(res.body.errors).to.be.an('Array');\n+          expect(res.body.errors)\n+            .to.include('The email field is required.');\n+          expect(res.body.data).to.be.undefined;","path":"test/controllers/auth.spec.js","position":73,"original_position":73,"commit_id":"6c4e6dda59f5691868e82c5f3c9141b86722a828","original_commit_id":"6c4e6dda59f5691868e82c5f3c9141b86722a828","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":"Expected an assignment or function call and instead saw an expression  no-unused-expressions","created_at":"2018-02-19T16:01:30Z","updated_at":"2018-02-19T16:01:31Z","html_url":"https://github.com/andela-stuff/andela-teams-core/pull/53#discussion_r169116127","pull_request_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/pulls/53","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/andela-stuff/andela-teams-core/pulls/comments/169116127"},"html":{"href":"https://github.com/andela-stuff/andela-teams-core/pull/53#discussion_r169116127"},"pull_request":{"href":"https://api.github.com/repos/andela-stuff/andela-teams-core/pulls/53"}}},"pull_request":{"url":"https://api.github.com/repos/andela-stuff/andela-teams-core/pulls/53","id":169998071,"html_url":"https://github.com/andela-stuff/andela-teams-core/pull/53","diff_url":"https://github.com/andela-stuff/andela-teams-core/pull/53.diff","patch_url":"https://github.com/andela-stuff/andela-teams-core/pull/53.patch","issue_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/issues/53","number":53,"state":"open","locked":false,"title":"#153902263 Create endpoints for teams (take 4)","user":{"login":"Chieze-Franklin","id":6097630,"avatar_url":"https://avatars2.githubusercontent.com/u/6097630?v=4","gravatar_id":"","url":"https://api.github.com/users/Chieze-Franklin","html_url":"https://github.com/Chieze-Franklin","followers_url":"https://api.github.com/users/Chieze-Franklin/followers","following_url":"https://api.github.com/users/Chieze-Franklin/following{/other_user}","gists_url":"https://api.github.com/users/Chieze-Franklin/gists{/gist_id}","starred_url":"https://api.github.com/users/Chieze-Franklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chieze-Franklin/subscriptions","organizations_url":"https://api.github.com/users/Chieze-Franklin/orgs","repos_url":"https://api.github.com/users/Chieze-Franklin/repos","events_url":"https://api.github.com/users/Chieze-Franklin/events{/privacy}","received_events_url":"https://api.github.com/users/Chieze-Franklin/received_events","type":"User","site_admin":false},"body":"#### What does this PR do?\r\n\r\nExposes endpoints for creating teams.\r\n#### Description of Task to be completed?\r\n\r\nThis task was originally started to expose endpoints with basic functionalities for creating teams. However, in the process of implementing such functionalities, many other things (including authentication) had to be implemented, making this PR quite untidy.\r\n\r\nThe push is an attempt to get this PR merged and closed so that work can proceed on a much neater slate.","created_at":"2018-02-19T16:01:03Z","updated_at":"2018-02-19T16:01:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e35ad814d8a26c4c766ef6b6d393c315027b4efd","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/pulls/53/commits","review_comments_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/pulls/53/comments","review_comment_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/issues/53/comments","statuses_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/statuses/6c4e6dda59f5691868e82c5f3c9141b86722a828","head":{"label":"andela-stuff:ft-teams-153902263","ref":"ft-teams-153902263","sha":"6c4e6dda59f5691868e82c5f3c9141b86722a828","user":{"login":"andela-stuff","id":33261671,"avatar_url":"https://avatars2.githubusercontent.com/u/33261671?v=4","gravatar_id":"","url":"https://api.github.com/users/andela-stuff","html_url":"https://github.com/andela-stuff","followers_url":"https://api.github.com/users/andela-stuff/followers","following_url":"https://api.github.com/users/andela-stuff/following{/other_user}","gists_url":"https://api.github.com/users/andela-stuff/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-stuff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-stuff/subscriptions","organizations_url":"https://api.github.com/users/andela-stuff/orgs","repos_url":"https://api.github.com/users/andela-stuff/repos","events_url":"https://api.github.com/users/andela-stuff/events{/privacy}","received_events_url":"https://api.github.com/users/andela-stuff/received_events","type":"Organization","site_admin":false},"repo":{"id":115416119,"name":"andela-teams-core","full_name":"andela-stuff/andela-teams-core","owner":{"login":"andela-stuff","id":33261671,"avatar_url":"https://avatars2.githubusercontent.com/u/33261671?v=4","gravatar_id":"","url":"https://api.github.com/users/andela-stuff","html_url":"https://github.com/andela-stuff","followers_url":"https://api.github.com/users/andela-stuff/followers","following_url":"https://api.github.com/users/andela-stuff/following{/other_user}","gists_url":"https://api.github.com/users/andela-stuff/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-stuff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-stuff/subscriptions","organizations_url":"https://api.github.com/users/andela-stuff/orgs","repos_url":"https://api.github.com/users/andela-stuff/repos","events_url":"https://api.github.com/users/andela-stuff/events{/privacy}","received_events_url":"https://api.github.com/users/andela-stuff/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela-stuff/andela-teams-core","description":"This is the core server for Andela Teams. Various integrations should be able to plug into this (in this future), and various clients should be able to utilize this in carrying out their tasks.","fork":false,"url":"https://api.github.com/repos/andela-stuff/andela-teams-core","forks_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/forks","keys_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/teams","hooks_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/hooks","issue_events_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/issues/events{/number}","events_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/events","assignees_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/assignees{/user}","branches_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/branches{/branch}","tags_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/tags","blobs_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/statuses/{sha}","languages_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/languages","stargazers_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/stargazers","contributors_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/contributors","subscribers_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/subscribers","subscription_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/subscription","commits_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/contents/{+path}","compare_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/merges","archive_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/downloads","issues_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/issues{/number}","pulls_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/pulls{/number}","milestones_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/milestones{/number}","notifications_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/labels{/name}","releases_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/releases{/id}","deployments_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/deployments","created_at":"2017-12-26T11:26:53Z","updated_at":"2018-01-07T21:33:41Z","pushed_at":"2018-02-19T16:01:04Z","git_url":"git://github.com/andela-stuff/andela-teams-core.git","ssh_url":"git@github.com:andela-stuff/andela-teams-core.git","clone_url":"https://github.com/andela-stuff/andela-teams-core.git","svn_url":"https://github.com/andela-stuff/andela-teams-core","homepage":null,"size":4236,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"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":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"andela-stuff:staging","ref":"staging","sha":"f27557b7c0518ede37b91fd076586ae14324f700","user":{"login":"andela-stuff","id":33261671,"avatar_url":"https://avatars2.githubusercontent.com/u/33261671?v=4","gravatar_id":"","url":"https://api.github.com/users/andela-stuff","html_url":"https://github.com/andela-stuff","followers_url":"https://api.github.com/users/andela-stuff/followers","following_url":"https://api.github.com/users/andela-stuff/following{/other_user}","gists_url":"https://api.github.com/users/andela-stuff/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-stuff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-stuff/subscriptions","organizations_url":"https://api.github.com/users/andela-stuff/orgs","repos_url":"https://api.github.com/users/andela-stuff/repos","events_url":"https://api.github.com/users/andela-stuff/events{/privacy}","received_events_url":"https://api.github.com/users/andela-stuff/received_events","type":"Organization","site_admin":false},"repo":{"id":115416119,"name":"andela-teams-core","full_name":"andela-stuff/andela-teams-core","owner":{"login":"andela-stuff","id":33261671,"avatar_url":"https://avatars2.githubusercontent.com/u/33261671?v=4","gravatar_id":"","url":"https://api.github.com/users/andela-stuff","html_url":"https://github.com/andela-stuff","followers_url":"https://api.github.com/users/andela-stuff/followers","following_url":"https://api.github.com/users/andela-stuff/following{/other_user}","gists_url":"https://api.github.com/users/andela-stuff/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-stuff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-stuff/subscriptions","organizations_url":"https://api.github.com/users/andela-stuff/orgs","repos_url":"https://api.github.com/users/andela-stuff/repos","events_url":"https://api.github.com/users/andela-stuff/events{/privacy}","received_events_url":"https://api.github.com/users/andela-stuff/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela-stuff/andela-teams-core","description":"This is the core server for Andela Teams. Various integrations should be able to plug into this (in this future), and various clients should be able to utilize this in carrying out their tasks.","fork":false,"url":"https://api.github.com/repos/andela-stuff/andela-teams-core","forks_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/forks","keys_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/teams","hooks_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/hooks","issue_events_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/issues/events{/number}","events_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/events","assignees_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/assignees{/user}","branches_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/branches{/branch}","tags_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/tags","blobs_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/statuses/{sha}","languages_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/languages","stargazers_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/stargazers","contributors_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/contributors","subscribers_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/subscribers","subscription_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/subscription","commits_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/contents/{+path}","compare_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/merges","archive_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/downloads","issues_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/issues{/number}","pulls_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/pulls{/number}","milestones_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/milestones{/number}","notifications_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/labels{/name}","releases_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/releases{/id}","deployments_url":"https://api.github.com/repos/andela-stuff/andela-teams-core/deployments","created_at":"2017-12-26T11:26:53Z","updated_at":"2018-01-07T21:33:41Z","pushed_at":"2018-02-19T16:01:04Z","git_url":"git://github.com/andela-stuff/andela-teams-core.git","ssh_url":"git@github.com:andela-stuff/andela-teams-core.git","clone_url":"https://github.com/andela-stuff/andela-teams-core.git","svn_url":"https://github.com/andela-stuff/andela-teams-core","homepage":null,"size":4236,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"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":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/andela-stuff/andela-teams-core/pulls/53"},"html":{"href":"https://github.com/andela-stuff/andela-teams-core/pull/53"},"issue":{"href":"https://api.github.com/repos/andela-stuff/andela-teams-core/issues/53"},"comments":{"href":"https://api.github.com/repos/andela-stuff/andela-teams-core/issues/53/comments"},"review_comments":{"href":"https://api.github.com/repos/andela-stuff/andela-teams-core/pulls/53/comments"},"review_comment":{"href":"https://api.github.com/repos/andela-stuff/andela-teams-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela-stuff/andela-teams-core/pulls/53/commits"},"statuses":{"href":"https://api.github.com/repos/andela-stuff/andela-teams-core/statuses/6c4e6dda59f5691868e82c5f3c9141b86722a828"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"houndci-bot"}}