{"action":"created","comment":{"url":"https://api.github.com/repos/wolox-training/jz-express-js/pulls/comments/233883768","pull_request_review_id":175400368,"id":233883768,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMzg4Mzc2OA==","diff_hunk":"@@ -0,0 +1,92 @@\n+const chai = require('chai'),\n+  dictum = require('dictum.js'),\n+  server = require('./../app'),\n+  User = require('../app/models').User,\n+  { createUser, userOne, anotherUser } = require('./utilUser'),\n+  expect = chai.expect,\n+  should = chai.should();\n+\n+describe('users', () => {\n+  describe('/users/ POST', () => {\n+    it('should create a new user without problems', done => {\n+      createUser(userOne).then(async res => {\n+        expect(res).have.status(201);\n+        const users = await User.find({\n+          where: {\n+            name: 'sarahi',\n+            lastName: 'torres',\n+            email: 'sarahi12hg@wolox.com'\n+          }\n+        });\n+        expect(users.password).to.not.equal('woloxwoloA1520');\n+        expect(users.name).to.be.equal('sarahi');\n+        expect(users.lastName).to.be.equal('torres');\n+        expect(users.email).to.be.equal('sarahi12hg@wolox.com');\n+        dictum.chai(res, 'create a new user');\n+        done();\n+      });\n+    });\n+    it('should fail creation of user because email domain is not valid', done => {\n+      createUser(anotherUser).catch(err => {\n+        expect(err).have.status(400);\n+        expect(err.response).be.json;\n+        expect(err.response.body).have.property('message');\n+        expect(err.response.body).have.property('internal_code');\n+        expect(err.response.body.internal_code).to.equal('saving_error');\n+        done();\n+      });\n+    });\n+    it('should fail creation of   user because password is no correct', done => {\n+      chai\n+        .request(server)\n+        .post('/users/')\n+        .send({\n+          name: 'sarahi',\n+          lastName: 'torres',\n+          email: 'sarahi12hg@wolox.com',\n+          password: 'facilfacil'\n+        })\n+        .catch(err => {\n+          expect(err).have.status(400);\n+          expect(err.response).be.json;\n+          expect(err.response.body).have.property('message');\n+          expect(err.response.body).have.property('internal_code');\n+          expect(err.response.body.internal_code).to.equal('saving_error');\n+          done();\n+        });\n+    });\n+    it('should fail creation of   user because some field is empty', done => {\n+      chai\n+        .request(server)\n+        .post('/users/')","path":"test/user.js","position":61,"original_position":61,"commit_id":"7dc7c55796012654220b3dcff8a00c6b76bc3375","original_commit_id":"7dc7c55796012654220b3dcff8a00c6b76bc3375","user":{"login":"jxczz2","id":44372404,"node_id":"MDQ6VXNlcjQ0MzcyNDA0","avatar_url":"https://avatars1.githubusercontent.com/u/44372404?v=4","gravatar_id":"","url":"https://api.github.com/users/jxczz2","html_url":"https://github.com/jxczz2","followers_url":"https://api.github.com/users/jxczz2/followers","following_url":"https://api.github.com/users/jxczz2/following{/other_user}","gists_url":"https://api.github.com/users/jxczz2/gists{/gist_id}","starred_url":"https://api.github.com/users/jxczz2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jxczz2/subscriptions","organizations_url":"https://api.github.com/users/jxczz2/orgs","repos_url":"https://api.github.com/users/jxczz2/repos","events_url":"https://api.github.com/users/jxczz2/events{/privacy}","received_events_url":"https://api.github.com/users/jxczz2/received_events","type":"User","site_admin":false},"body":"\r\nboth ? , or just the end?\r\n","created_at":"2018-11-15T15:17:47Z","updated_at":"2018-11-15T15:17:47Z","html_url":"https://github.com/wolox-training/jz-express-js/pull/6#discussion_r233883768","pull_request_url":"https://api.github.com/repos/wolox-training/jz-express-js/pulls/6","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/wolox-training/jz-express-js/pulls/comments/233883768"},"html":{"href":"https://github.com/wolox-training/jz-express-js/pull/6#discussion_r233883768"},"pull_request":{"href":"https://api.github.com/repos/wolox-training/jz-express-js/pulls/6"}},"in_reply_to_id":233872713},"pull_request":{"url":"https://api.github.com/repos/wolox-training/jz-express-js/pulls/6","id":230998926,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMwOTk4OTI2","html_url":"https://github.com/wolox-training/jz-express-js/pull/6","diff_url":"https://github.com/wolox-training/jz-express-js/pull/6.diff","patch_url":"https://github.com/wolox-training/jz-express-js/pull/6.patch","issue_url":"https://api.github.com/repos/wolox-training/jz-express-js/issues/6","number":6,"state":"open","locked":false,"title":"signup test is added","user":{"login":"jxczz2","id":44372404,"node_id":"MDQ6VXNlcjQ0MzcyNDA0","avatar_url":"https://avatars1.githubusercontent.com/u/44372404?v=4","gravatar_id":"","url":"https://api.github.com/users/jxczz2","html_url":"https://github.com/jxczz2","followers_url":"https://api.github.com/users/jxczz2/followers","following_url":"https://api.github.com/users/jxczz2/following{/other_user}","gists_url":"https://api.github.com/users/jxczz2/gists{/gist_id}","starred_url":"https://api.github.com/users/jxczz2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jxczz2/subscriptions","organizations_url":"https://api.github.com/users/jxczz2/orgs","repos_url":"https://api.github.com/users/jxczz2/repos","events_url":"https://api.github.com/users/jxczz2/events{/privacy}","received_events_url":"https://api.github.com/users/jxczz2/received_events","type":"User","site_admin":false},"body":"## Summary\r\n\r\nSignup test is added.\r\n\r\n## Known Issues\r\n\r\nno problem.\r\n\r\n## Trello Card\r\n\r\nhttps://trello.com/c/kFXBAXTK\r\n","created_at":"2018-11-14T22:08:38Z","updated_at":"2018-11-15T15:17:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a485ffb2a5aa5ef452cb3b6a2bea15d78dca25b0","assignee":{"login":"jxczz2","id":44372404,"node_id":"MDQ6VXNlcjQ0MzcyNDA0","avatar_url":"https://avatars1.githubusercontent.com/u/44372404?v=4","gravatar_id":"","url":"https://api.github.com/users/jxczz2","html_url":"https://github.com/jxczz2","followers_url":"https://api.github.com/users/jxczz2/followers","following_url":"https://api.github.com/users/jxczz2/following{/other_user}","gists_url":"https://api.github.com/users/jxczz2/gists{/gist_id}","starred_url":"https://api.github.com/users/jxczz2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jxczz2/subscriptions","organizations_url":"https://api.github.com/users/jxczz2/orgs","repos_url":"https://api.github.com/users/jxczz2/repos","events_url":"https://api.github.com/users/jxczz2/events{/privacy}","received_events_url":"https://api.github.com/users/jxczz2/received_events","type":"User","site_admin":false},"assignees":[{"login":"jxczz2","id":44372404,"node_id":"MDQ6VXNlcjQ0MzcyNDA0","avatar_url":"https://avatars1.githubusercontent.com/u/44372404?v=4","gravatar_id":"","url":"https://api.github.com/users/jxczz2","html_url":"https://github.com/jxczz2","followers_url":"https://api.github.com/users/jxczz2/followers","following_url":"https://api.github.com/users/jxczz2/following{/other_user}","gists_url":"https://api.github.com/users/jxczz2/gists{/gist_id}","starred_url":"https://api.github.com/users/jxczz2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jxczz2/subscriptions","organizations_url":"https://api.github.com/users/jxczz2/orgs","repos_url":"https://api.github.com/users/jxczz2/repos","events_url":"https://api.github.com/users/jxczz2/events{/privacy}","received_events_url":"https://api.github.com/users/jxczz2/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/wolox-training/jz-express-js/pulls/6/commits","review_comments_url":"https://api.github.com/repos/wolox-training/jz-express-js/pulls/6/comments","review_comment_url":"https://api.github.com/repos/wolox-training/jz-express-js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wolox-training/jz-express-js/issues/6/comments","statuses_url":"https://api.github.com/repos/wolox-training/jz-express-js/statuses/7dc7c55796012654220b3dcff8a00c6b76bc3375","head":{"label":"wolox-training:signUpTest","ref":"signUpTest","sha":"7dc7c55796012654220b3dcff8a00c6b76bc3375","user":{"login":"wolox-training","id":14113351,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTEzMzUx","avatar_url":"https://avatars1.githubusercontent.com/u/14113351?v=4","gravatar_id":"","url":"https://api.github.com/users/wolox-training","html_url":"https://github.com/wolox-training","followers_url":"https://api.github.com/users/wolox-training/followers","following_url":"https://api.github.com/users/wolox-training/following{/other_user}","gists_url":"https://api.github.com/users/wolox-training/gists{/gist_id}","starred_url":"https://api.github.com/users/wolox-training/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolox-training/subscriptions","organizations_url":"https://api.github.com/users/wolox-training/orgs","repos_url":"https://api.github.com/users/wolox-training/repos","events_url":"https://api.github.com/users/wolox-training/events{/privacy}","received_events_url":"https://api.github.com/users/wolox-training/received_events","type":"Organization","site_admin":false},"repo":{"id":154145247,"node_id":"MDEwOlJlcG9zaXRvcnkxNTQxNDUyNDc=","name":"jz-express-js","full_name":"wolox-training/jz-express-js","private":false,"owner":{"login":"wolox-training","id":14113351,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTEzMzUx","avatar_url":"https://avatars1.githubusercontent.com/u/14113351?v=4","gravatar_id":"","url":"https://api.github.com/users/wolox-training","html_url":"https://github.com/wolox-training","followers_url":"https://api.github.com/users/wolox-training/followers","following_url":"https://api.github.com/users/wolox-training/following{/other_user}","gists_url":"https://api.github.com/users/wolox-training/gists{/gist_id}","starred_url":"https://api.github.com/users/wolox-training/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolox-training/subscriptions","organizations_url":"https://api.github.com/users/wolox-training/orgs","repos_url":"https://api.github.com/users/wolox-training/repos","events_url":"https://api.github.com/users/wolox-training/events{/privacy}","received_events_url":"https://api.github.com/users/wolox-training/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/wolox-training/jz-express-js","description":null,"fork":false,"url":"https://api.github.com/repos/wolox-training/jz-express-js","forks_url":"https://api.github.com/repos/wolox-training/jz-express-js/forks","keys_url":"https://api.github.com/repos/wolox-training/jz-express-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wolox-training/jz-express-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wolox-training/jz-express-js/teams","hooks_url":"https://api.github.com/repos/wolox-training/jz-express-js/hooks","issue_events_url":"https://api.github.com/repos/wolox-training/jz-express-js/issues/events{/number}","events_url":"https://api.github.com/repos/wolox-training/jz-express-js/events","assignees_url":"https://api.github.com/repos/wolox-training/jz-express-js/assignees{/user}","branches_url":"https://api.github.com/repos/wolox-training/jz-express-js/branches{/branch}","tags_url":"https://api.github.com/repos/wolox-training/jz-express-js/tags","blobs_url":"https://api.github.com/repos/wolox-training/jz-express-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wolox-training/jz-express-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wolox-training/jz-express-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/wolox-training/jz-express-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wolox-training/jz-express-js/statuses/{sha}","languages_url":"https://api.github.com/repos/wolox-training/jz-express-js/languages","stargazers_url":"https://api.github.com/repos/wolox-training/jz-express-js/stargazers","contributors_url":"https://api.github.com/repos/wolox-training/jz-express-js/contributors","subscribers_url":"https://api.github.com/repos/wolox-training/jz-express-js/subscribers","subscription_url":"https://api.github.com/repos/wolox-training/jz-express-js/subscription","commits_url":"https://api.github.com/repos/wolox-training/jz-express-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/wolox-training/jz-express-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/wolox-training/jz-express-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/wolox-training/jz-express-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/wolox-training/jz-express-js/contents/{+path}","compare_url":"https://api.github.com/repos/wolox-training/jz-express-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wolox-training/jz-express-js/merges","archive_url":"https://api.github.com/repos/wolox-training/jz-express-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wolox-training/jz-express-js/downloads","issues_url":"https://api.github.com/repos/wolox-training/jz-express-js/issues{/number}","pulls_url":"https://api.github.com/repos/wolox-training/jz-express-js/pulls{/number}","milestones_url":"https://api.github.com/repos/wolox-training/jz-express-js/milestones{/number}","notifications_url":"https://api.github.com/repos/wolox-training/jz-express-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wolox-training/jz-express-js/labels{/name}","releases_url":"https://api.github.com/repos/wolox-training/jz-express-js/releases{/id}","deployments_url":"https://api.github.com/repos/wolox-training/jz-express-js/deployments","created_at":"2018-10-22T13:04:20Z","updated_at":"2018-11-14T16:14:13Z","pushed_at":"2018-11-15T14:58:15Z","git_url":"git://github.com/wolox-training/jz-express-js.git","ssh_url":"git@github.com:wolox-training/jz-express-js.git","clone_url":"https://github.com/wolox-training/jz-express-js.git","svn_url":"https://github.com/wolox-training/jz-express-js","homepage":null,"size":373,"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":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"wolox-training:master","ref":"master","sha":"a4cb934bcb616730e80a3d8724060c31209b0af2","user":{"login":"wolox-training","id":14113351,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTEzMzUx","avatar_url":"https://avatars1.githubusercontent.com/u/14113351?v=4","gravatar_id":"","url":"https://api.github.com/users/wolox-training","html_url":"https://github.com/wolox-training","followers_url":"https://api.github.com/users/wolox-training/followers","following_url":"https://api.github.com/users/wolox-training/following{/other_user}","gists_url":"https://api.github.com/users/wolox-training/gists{/gist_id}","starred_url":"https://api.github.com/users/wolox-training/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolox-training/subscriptions","organizations_url":"https://api.github.com/users/wolox-training/orgs","repos_url":"https://api.github.com/users/wolox-training/repos","events_url":"https://api.github.com/users/wolox-training/events{/privacy}","received_events_url":"https://api.github.com/users/wolox-training/received_events","type":"Organization","site_admin":false},"repo":{"id":154145247,"node_id":"MDEwOlJlcG9zaXRvcnkxNTQxNDUyNDc=","name":"jz-express-js","full_name":"wolox-training/jz-express-js","private":false,"owner":{"login":"wolox-training","id":14113351,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTEzMzUx","avatar_url":"https://avatars1.githubusercontent.com/u/14113351?v=4","gravatar_id":"","url":"https://api.github.com/users/wolox-training","html_url":"https://github.com/wolox-training","followers_url":"https://api.github.com/users/wolox-training/followers","following_url":"https://api.github.com/users/wolox-training/following{/other_user}","gists_url":"https://api.github.com/users/wolox-training/gists{/gist_id}","starred_url":"https://api.github.com/users/wolox-training/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolox-training/subscriptions","organizations_url":"https://api.github.com/users/wolox-training/orgs","repos_url":"https://api.github.com/users/wolox-training/repos","events_url":"https://api.github.com/users/wolox-training/events{/privacy}","received_events_url":"https://api.github.com/users/wolox-training/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/wolox-training/jz-express-js","description":null,"fork":false,"url":"https://api.github.com/repos/wolox-training/jz-express-js","forks_url":"https://api.github.com/repos/wolox-training/jz-express-js/forks","keys_url":"https://api.github.com/repos/wolox-training/jz-express-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wolox-training/jz-express-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wolox-training/jz-express-js/teams","hooks_url":"https://api.github.com/repos/wolox-training/jz-express-js/hooks","issue_events_url":"https://api.github.com/repos/wolox-training/jz-express-js/issues/events{/number}","events_url":"https://api.github.com/repos/wolox-training/jz-express-js/events","assignees_url":"https://api.github.com/repos/wolox-training/jz-express-js/assignees{/user}","branches_url":"https://api.github.com/repos/wolox-training/jz-express-js/branches{/branch}","tags_url":"https://api.github.com/repos/wolox-training/jz-express-js/tags","blobs_url":"https://api.github.com/repos/wolox-training/jz-express-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wolox-training/jz-express-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wolox-training/jz-express-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/wolox-training/jz-express-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wolox-training/jz-express-js/statuses/{sha}","languages_url":"https://api.github.com/repos/wolox-training/jz-express-js/languages","stargazers_url":"https://api.github.com/repos/wolox-training/jz-express-js/stargazers","contributors_url":"https://api.github.com/repos/wolox-training/jz-express-js/contributors","subscribers_url":"https://api.github.com/repos/wolox-training/jz-express-js/subscribers","subscription_url":"https://api.github.com/repos/wolox-training/jz-express-js/subscription","commits_url":"https://api.github.com/repos/wolox-training/jz-express-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/wolox-training/jz-express-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/wolox-training/jz-express-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/wolox-training/jz-express-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/wolox-training/jz-express-js/contents/{+path}","compare_url":"https://api.github.com/repos/wolox-training/jz-express-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wolox-training/jz-express-js/merges","archive_url":"https://api.github.com/repos/wolox-training/jz-express-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wolox-training/jz-express-js/downloads","issues_url":"https://api.github.com/repos/wolox-training/jz-express-js/issues{/number}","pulls_url":"https://api.github.com/repos/wolox-training/jz-express-js/pulls{/number}","milestones_url":"https://api.github.com/repos/wolox-training/jz-express-js/milestones{/number}","notifications_url":"https://api.github.com/repos/wolox-training/jz-express-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wolox-training/jz-express-js/labels{/name}","releases_url":"https://api.github.com/repos/wolox-training/jz-express-js/releases{/id}","deployments_url":"https://api.github.com/repos/wolox-training/jz-express-js/deployments","created_at":"2018-10-22T13:04:20Z","updated_at":"2018-11-14T16:14:13Z","pushed_at":"2018-11-15T14:58:15Z","git_url":"git://github.com/wolox-training/jz-express-js.git","ssh_url":"git@github.com:wolox-training/jz-express-js.git","clone_url":"https://github.com/wolox-training/jz-express-js.git","svn_url":"https://github.com/wolox-training/jz-express-js","homepage":null,"size":373,"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":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wolox-training/jz-express-js/pulls/6"},"html":{"href":"https://github.com/wolox-training/jz-express-js/pull/6"},"issue":{"href":"https://api.github.com/repos/wolox-training/jz-express-js/issues/6"},"comments":{"href":"https://api.github.com/repos/wolox-training/jz-express-js/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/wolox-training/jz-express-js/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/wolox-training/jz-express-js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wolox-training/jz-express-js/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/wolox-training/jz-express-js/statuses/7dc7c55796012654220b3dcff8a00c6b76bc3375"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"jxczz2"}}