{"action":"created","comment":{"url":"https://api.github.com/repos/andela/rivendell-ah/pulls/comments/205545740","pull_request_review_id":140838269,"id":205545740,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTU0NTc0MA==","diff_hunk":"@@ -0,0 +1,60 @@\n+const chai = require('chai');\n+const app = require('../index');\n+const request = require('supertest')(app);\n+const User = require('../models/User');\n+const mocha = require('mocha');\n+const faker = require('faker');\n+\n+const describe = mocha.describe;\n+\n+const expect = chai.expect; \n+const user =  {\n+    email: faker.internet.email(),\n+    username:faker.name.lastName(),\n+    password: faker.internet.password(),\n+};\n+\n+\n+describe('POST requests', function() {\n+    beforeEach(function(done){\n+        User.remove({}, function(err){\n+          done();\n+        });\n+        \n+    });\n+     describe('/api/users/', function(){\n+        describe('if the inputed values are valid', function(){\n+            describe('status code', function(){\n+                it('should be equal to 201', function(done){\n+                    request.post('/api/users/')\n+                    .send({user: user})\n+                    .expect(201, done);\n+                }); \n+            })\n+            describe('request body', function(){\n+                it('should have a data property that contains a token string property', function(done){\n+                    request.post('/api/users/')\n+                    .send({user:user})\n+                    .end(function(err, resp){\n+                        expect(resp.body).property('data')\n+                            .to.have.property('token')\n+                        done();\n+                    });\n+                });\n+\n+                it('should have a data property that contains a username and email  properties', function(done){\n+                    request.post('/api/users/')\n+                    .send({user: user})\n+                    .end(function(err, resp){\n+                        expect(resp.body).property('data')\n+                            .to.have.property('email');","path":"test/signup.test.js","position":50,"original_position":50,"commit_id":"b3e2650e891abae724425bfd0e73740022439e1d","original_commit_id":"b3e2650e891abae724425bfd0e73740022439e1d","user":{"login":"houndci-bot","id":6697940,"node_id":"MDQ6VXNlcjY2OTc5NDA=","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 indentation of 16 spaces but found 28  indent","created_at":"2018-07-26T17:47:59Z","updated_at":"2018-07-26T17:48:00Z","html_url":"https://github.com/andela/rivendell-ah/pull/7#discussion_r205545740","pull_request_url":"https://api.github.com/repos/andela/rivendell-ah/pulls/7","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/andela/rivendell-ah/pulls/comments/205545740"},"html":{"href":"https://github.com/andela/rivendell-ah/pull/7#discussion_r205545740"},"pull_request":{"href":"https://api.github.com/repos/andela/rivendell-ah/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/andela/rivendell-ah/pulls/7","id":203604751,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzNjA0NzUx","html_url":"https://github.com/andela/rivendell-ah/pull/7","diff_url":"https://github.com/andela/rivendell-ah/pull/7.diff","patch_url":"https://github.com/andela/rivendell-ah/pull/7.patch","issue_url":"https://api.github.com/repos/andela/rivendell-ah/issues/7","number":7,"state":"open","locked":false,"title":"#159204691: user should receive a json web token on authentication","user":{"login":"chidioguejiofor","id":38565349,"node_id":"MDQ6VXNlcjM4NTY1MzQ5","avatar_url":"https://avatars1.githubusercontent.com/u/38565349?v=4","gravatar_id":"","url":"https://api.github.com/users/chidioguejiofor","html_url":"https://github.com/chidioguejiofor","followers_url":"https://api.github.com/users/chidioguejiofor/followers","following_url":"https://api.github.com/users/chidioguejiofor/following{/other_user}","gists_url":"https://api.github.com/users/chidioguejiofor/gists{/gist_id}","starred_url":"https://api.github.com/users/chidioguejiofor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chidioguejiofor/subscriptions","organizations_url":"https://api.github.com/users/chidioguejiofor/orgs","repos_url":"https://api.github.com/users/chidioguejiofor/repos","events_url":"https://api.github.com/users/chidioguejiofor/events{/privacy}","received_events_url":"https://api.github.com/users/chidioguejiofor/received_events","type":"User","site_admin":false},"body":"#### What does this PR do?\r\n- adds  signup test to the app\r\n- adds a service folder to the app\r\n- creates a .env-sample file to the app\r\n- sets up testing framework `mocha, chai and supertest` to be used in the app.\r\n\r\n#### Description of Task to be completed?\r\n- as a user, I should receive a JSON Web Token on authentication\r\n\r\n#### How should this be manually tested?\r\n- run the command `npm install` to install all the dependencies\r\n- run `npm start` in order to start the server\r\n- create a post request to **localhost:3000/api/users/**. The body of this request should be similar to \r\nhave the properties in the JSON below:\r\n{\r\n\t\"user\" : {\r\n\t\t\"email\": \"chidi@email.com\",\r\n\t\t\"username\": \"username101\",\r\n\t\t\"password\": \"password1\"\r\n\t}\r\n}\r\n- you should receive a response like this:\r\n\r\n{\r\n    \"data\": {\r\n        \"email\": \"chidi@email.com\",\r\n        \"username\": \"username101\",\r\n        \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImNoaWRpQGVtYWlsLmNvbSIsInVzZXJuYW1lIjoidXNlcm5hbWUxMDEiLCJwYXNzd29yZCI6InBhc3N3b3JkMSIsImlhdCI6MTUzMjQ1NDE0NCwiZXhwIjoxNTMyNzEzMzQ0fQ.njMCExUNOhkQwLk4vzE9ktCQvG1LBaWqNXfCnpprumw\"\r\n    }\r\n}\r\n\r\n\r\n#### Any background context you want to provide?\r\n- Ensure that mongodb is set up and running\r\n#### What are the relevant pivotal tracker stories?\r\n- 159204691\r\n#### Screenshots (if appropriate):\r\n<img width=\"1146\" alt=\"screen shot 2018-07-24 at 6 45 28 pm\" src=\"https://user-images.githubusercontent.com/38565349/43156353-cdd1683a-8f71-11e8-88f5-ccd461815508.png\">\r\n\r\n#### Questions:\r\n- None","created_at":"2018-07-24T17:46:28Z","updated_at":"2018-07-26T17:48:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ad388c8b924a15acec325ae0b3e0098dd4a8e83e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/andela/rivendell-ah/pulls/7/commits","review_comments_url":"https://api.github.com/repos/andela/rivendell-ah/pulls/7/comments","review_comment_url":"https://api.github.com/repos/andela/rivendell-ah/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela/rivendell-ah/issues/7/comments","statuses_url":"https://api.github.com/repos/andela/rivendell-ah/statuses/b3e2650e891abae724425bfd0e73740022439e1d","head":{"label":"andela:ft/userReceiveJWTResponse/#159204691","ref":"ft/userReceiveJWTResponse/#159204691","sha":"b3e2650e891abae724425bfd0e73740022439e1d","user":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":141551362,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE1NTEzNjI=","name":"rivendell-ah","full_name":"andela/rivendell-ah","owner":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/rivendell-ah","description":null,"fork":false,"url":"https://api.github.com/repos/andela/rivendell-ah","forks_url":"https://api.github.com/repos/andela/rivendell-ah/forks","keys_url":"https://api.github.com/repos/andela/rivendell-ah/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/rivendell-ah/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/rivendell-ah/teams","hooks_url":"https://api.github.com/repos/andela/rivendell-ah/hooks","issue_events_url":"https://api.github.com/repos/andela/rivendell-ah/issues/events{/number}","events_url":"https://api.github.com/repos/andela/rivendell-ah/events","assignees_url":"https://api.github.com/repos/andela/rivendell-ah/assignees{/user}","branches_url":"https://api.github.com/repos/andela/rivendell-ah/branches{/branch}","tags_url":"https://api.github.com/repos/andela/rivendell-ah/tags","blobs_url":"https://api.github.com/repos/andela/rivendell-ah/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/rivendell-ah/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/rivendell-ah/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/rivendell-ah/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/rivendell-ah/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/rivendell-ah/languages","stargazers_url":"https://api.github.com/repos/andela/rivendell-ah/stargazers","contributors_url":"https://api.github.com/repos/andela/rivendell-ah/contributors","subscribers_url":"https://api.github.com/repos/andela/rivendell-ah/subscribers","subscription_url":"https://api.github.com/repos/andela/rivendell-ah/subscription","commits_url":"https://api.github.com/repos/andela/rivendell-ah/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/rivendell-ah/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/rivendell-ah/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/rivendell-ah/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/rivendell-ah/contents/{+path}","compare_url":"https://api.github.com/repos/andela/rivendell-ah/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/rivendell-ah/merges","archive_url":"https://api.github.com/repos/andela/rivendell-ah/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/rivendell-ah/downloads","issues_url":"https://api.github.com/repos/andela/rivendell-ah/issues{/number}","pulls_url":"https://api.github.com/repos/andela/rivendell-ah/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/rivendell-ah/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/rivendell-ah/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/rivendell-ah/labels{/name}","releases_url":"https://api.github.com/repos/andela/rivendell-ah/releases{/id}","deployments_url":"https://api.github.com/repos/andela/rivendell-ah/deployments","created_at":"2018-07-19T08:51:46Z","updated_at":"2018-07-24T10:54:42Z","pushed_at":"2018-07-26T17:47:14Z","git_url":"git://github.com/andela/rivendell-ah.git","ssh_url":"git@github.com:andela/rivendell-ah.git","clone_url":"https://github.com/andela/rivendell-ah.git","svn_url":"https://github.com/andela/rivendell-ah","homepage":null,"size":88,"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":0,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":0,"open_issues":3,"watchers":0,"default_branch":"staging"}},"base":{"label":"andela:staging","ref":"staging","sha":"bcc543c859914d0c6293be4b0fcd05385db45152","user":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":141551362,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE1NTEzNjI=","name":"rivendell-ah","full_name":"andela/rivendell-ah","owner":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/rivendell-ah","description":null,"fork":false,"url":"https://api.github.com/repos/andela/rivendell-ah","forks_url":"https://api.github.com/repos/andela/rivendell-ah/forks","keys_url":"https://api.github.com/repos/andela/rivendell-ah/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/rivendell-ah/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/rivendell-ah/teams","hooks_url":"https://api.github.com/repos/andela/rivendell-ah/hooks","issue_events_url":"https://api.github.com/repos/andela/rivendell-ah/issues/events{/number}","events_url":"https://api.github.com/repos/andela/rivendell-ah/events","assignees_url":"https://api.github.com/repos/andela/rivendell-ah/assignees{/user}","branches_url":"https://api.github.com/repos/andela/rivendell-ah/branches{/branch}","tags_url":"https://api.github.com/repos/andela/rivendell-ah/tags","blobs_url":"https://api.github.com/repos/andela/rivendell-ah/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/rivendell-ah/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/rivendell-ah/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/rivendell-ah/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/rivendell-ah/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/rivendell-ah/languages","stargazers_url":"https://api.github.com/repos/andela/rivendell-ah/stargazers","contributors_url":"https://api.github.com/repos/andela/rivendell-ah/contributors","subscribers_url":"https://api.github.com/repos/andela/rivendell-ah/subscribers","subscription_url":"https://api.github.com/repos/andela/rivendell-ah/subscription","commits_url":"https://api.github.com/repos/andela/rivendell-ah/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/rivendell-ah/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/rivendell-ah/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/rivendell-ah/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/rivendell-ah/contents/{+path}","compare_url":"https://api.github.com/repos/andela/rivendell-ah/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/rivendell-ah/merges","archive_url":"https://api.github.com/repos/andela/rivendell-ah/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/rivendell-ah/downloads","issues_url":"https://api.github.com/repos/andela/rivendell-ah/issues{/number}","pulls_url":"https://api.github.com/repos/andela/rivendell-ah/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/rivendell-ah/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/rivendell-ah/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/rivendell-ah/labels{/name}","releases_url":"https://api.github.com/repos/andela/rivendell-ah/releases{/id}","deployments_url":"https://api.github.com/repos/andela/rivendell-ah/deployments","created_at":"2018-07-19T08:51:46Z","updated_at":"2018-07-24T10:54:42Z","pushed_at":"2018-07-26T17:47:14Z","git_url":"git://github.com/andela/rivendell-ah.git","ssh_url":"git@github.com:andela/rivendell-ah.git","clone_url":"https://github.com/andela/rivendell-ah.git","svn_url":"https://github.com/andela/rivendell-ah","homepage":null,"size":88,"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":0,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":0,"open_issues":3,"watchers":0,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/andela/rivendell-ah/pulls/7"},"html":{"href":"https://github.com/andela/rivendell-ah/pull/7"},"issue":{"href":"https://api.github.com/repos/andela/rivendell-ah/issues/7"},"comments":{"href":"https://api.github.com/repos/andela/rivendell-ah/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/andela/rivendell-ah/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/andela/rivendell-ah/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela/rivendell-ah/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/andela/rivendell-ah/statuses/b3e2650e891abae724425bfd0e73740022439e1d"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"houndci-bot"}}