{"action":"created","comment":{"url":"https://api.github.com/repos/arianna-h-h/iot-api/pulls/comments/142154889","pull_request_review_id":66474602,"id":142154889,"diff_hunk":"@@ -0,0 +1,55 @@\n+'use strict';\n+\n+const request = require('supertest');\n+const deviceRoutes = require('../src/routes');\n+const { server, db } = require('./createTestServer');\n+\n+\n+const devices = deviceRoutes(server);\n+\n+\n+function dropTestCollection(database) {\n+  database.db.dropCollection('devices', (err, result) => {\n+    console.log('db dropped');\n+  });\n+}\n+\n+\n+afterEach(() => dropTestCollection(db),\n+);\n+\n+describe('POST /devices', () => {\n+  describe('When given a name', () => {\n+    it('returns successful API response', () => (\n+      request(devices)\n+        .post('/devices').send({ name: 'Arianna', id: 'test-id' })\n+        .then((response) => {\n+          expect(response.statusCode).toBe(200);\n+          expect(response.text).toBe('\"New device added: Arianna test-id\"');\n+          expect(db.db.collection('devices').s.namespace).toBe('apiTest.devices');","path":"test/routes.test.js","position":29,"original_position":29,"commit_id":"0a309f726f58002ce61f5f6878c75ec5e2b60868","original_commit_id":"0a309f726f58002ce61f5f6878c75ec5e2b60868","user":{"login":"arianna-h-h","id":21130217,"avatar_url":"https://avatars0.githubusercontent.com/u/21130217?v=4","gravatar_id":"","url":"https://api.github.com/users/arianna-h-h","html_url":"https://github.com/arianna-h-h","followers_url":"https://api.github.com/users/arianna-h-h/followers","following_url":"https://api.github.com/users/arianna-h-h/following{/other_user}","gists_url":"https://api.github.com/users/arianna-h-h/gists{/gist_id}","starred_url":"https://api.github.com/users/arianna-h-h/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arianna-h-h/subscriptions","organizations_url":"https://api.github.com/users/arianna-h-h/orgs","repos_url":"https://api.github.com/users/arianna-h-h/repos","events_url":"https://api.github.com/users/arianna-h-h/events{/privacy}","received_events_url":"https://api.github.com/users/arianna-h-h/received_events","type":"User","site_admin":false},"body":"done","created_at":"2017-10-02T14:30:20Z","updated_at":"2017-10-02T14:30:20Z","html_url":"https://github.com/arianna-h-h/iot-api/pull/4#discussion_r142154889","pull_request_url":"https://api.github.com/repos/arianna-h-h/iot-api/pulls/4","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/arianna-h-h/iot-api/pulls/comments/142154889"},"html":{"href":"https://github.com/arianna-h-h/iot-api/pull/4#discussion_r142154889"},"pull_request":{"href":"https://api.github.com/repos/arianna-h-h/iot-api/pulls/4"}},"in_reply_to_id":141978083},"pull_request":{"url":"https://api.github.com/repos/arianna-h-h/iot-api/pulls/4","id":143743030,"html_url":"https://github.com/arianna-h-h/iot-api/pull/4","diff_url":"https://github.com/arianna-h-h/iot-api/pull/4.diff","patch_url":"https://github.com/arianna-h-h/iot-api/pull/4.patch","issue_url":"https://api.github.com/repos/arianna-h-h/iot-api/issues/4","number":4,"state":"open","locked":false,"title":"Add Device model and test","user":{"login":"arianna-h-h","id":21130217,"avatar_url":"https://avatars0.githubusercontent.com/u/21130217?v=4","gravatar_id":"","url":"https://api.github.com/users/arianna-h-h","html_url":"https://github.com/arianna-h-h","followers_url":"https://api.github.com/users/arianna-h-h/followers","following_url":"https://api.github.com/users/arianna-h-h/following{/other_user}","gists_url":"https://api.github.com/users/arianna-h-h/gists{/gist_id}","starred_url":"https://api.github.com/users/arianna-h-h/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arianna-h-h/subscriptions","organizations_url":"https://api.github.com/users/arianna-h-h/orgs","repos_url":"https://api.github.com/users/arianna-h-h/repos","events_url":"https://api.github.com/users/arianna-h-h/events{/privacy}","received_events_url":"https://api.github.com/users/arianna-h-h/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-09-28T20:05:51Z","updated_at":"2017-10-02T14:30:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4318d3ff6003d5fa77631cf7060181de6cc03ea9","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/arianna-h-h/iot-api/pulls/4/commits","review_comments_url":"https://api.github.com/repos/arianna-h-h/iot-api/pulls/4/comments","review_comment_url":"https://api.github.com/repos/arianna-h-h/iot-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/arianna-h-h/iot-api/issues/4/comments","statuses_url":"https://api.github.com/repos/arianna-h-h/iot-api/statuses/0a309f726f58002ce61f5f6878c75ec5e2b60868","head":{"label":"arianna-h-h:addDevice","ref":"addDevice","sha":"0a309f726f58002ce61f5f6878c75ec5e2b60868","user":{"login":"arianna-h-h","id":21130217,"avatar_url":"https://avatars0.githubusercontent.com/u/21130217?v=4","gravatar_id":"","url":"https://api.github.com/users/arianna-h-h","html_url":"https://github.com/arianna-h-h","followers_url":"https://api.github.com/users/arianna-h-h/followers","following_url":"https://api.github.com/users/arianna-h-h/following{/other_user}","gists_url":"https://api.github.com/users/arianna-h-h/gists{/gist_id}","starred_url":"https://api.github.com/users/arianna-h-h/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arianna-h-h/subscriptions","organizations_url":"https://api.github.com/users/arianna-h-h/orgs","repos_url":"https://api.github.com/users/arianna-h-h/repos","events_url":"https://api.github.com/users/arianna-h-h/events{/privacy}","received_events_url":"https://api.github.com/users/arianna-h-h/received_events","type":"User","site_admin":false},"repo":{"id":104931041,"name":"iot-api","full_name":"arianna-h-h/iot-api","owner":{"login":"arianna-h-h","id":21130217,"avatar_url":"https://avatars0.githubusercontent.com/u/21130217?v=4","gravatar_id":"","url":"https://api.github.com/users/arianna-h-h","html_url":"https://github.com/arianna-h-h","followers_url":"https://api.github.com/users/arianna-h-h/followers","following_url":"https://api.github.com/users/arianna-h-h/following{/other_user}","gists_url":"https://api.github.com/users/arianna-h-h/gists{/gist_id}","starred_url":"https://api.github.com/users/arianna-h-h/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arianna-h-h/subscriptions","organizations_url":"https://api.github.com/users/arianna-h-h/orgs","repos_url":"https://api.github.com/users/arianna-h-h/repos","events_url":"https://api.github.com/users/arianna-h-h/events{/privacy}","received_events_url":"https://api.github.com/users/arianna-h-h/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/arianna-h-h/iot-api","description":null,"fork":false,"url":"https://api.github.com/repos/arianna-h-h/iot-api","forks_url":"https://api.github.com/repos/arianna-h-h/iot-api/forks","keys_url":"https://api.github.com/repos/arianna-h-h/iot-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/arianna-h-h/iot-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/arianna-h-h/iot-api/teams","hooks_url":"https://api.github.com/repos/arianna-h-h/iot-api/hooks","issue_events_url":"https://api.github.com/repos/arianna-h-h/iot-api/issues/events{/number}","events_url":"https://api.github.com/repos/arianna-h-h/iot-api/events","assignees_url":"https://api.github.com/repos/arianna-h-h/iot-api/assignees{/user}","branches_url":"https://api.github.com/repos/arianna-h-h/iot-api/branches{/branch}","tags_url":"https://api.github.com/repos/arianna-h-h/iot-api/tags","blobs_url":"https://api.github.com/repos/arianna-h-h/iot-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/arianna-h-h/iot-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/arianna-h-h/iot-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/arianna-h-h/iot-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/arianna-h-h/iot-api/statuses/{sha}","languages_url":"https://api.github.com/repos/arianna-h-h/iot-api/languages","stargazers_url":"https://api.github.com/repos/arianna-h-h/iot-api/stargazers","contributors_url":"https://api.github.com/repos/arianna-h-h/iot-api/contributors","subscribers_url":"https://api.github.com/repos/arianna-h-h/iot-api/subscribers","subscription_url":"https://api.github.com/repos/arianna-h-h/iot-api/subscription","commits_url":"https://api.github.com/repos/arianna-h-h/iot-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/arianna-h-h/iot-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/arianna-h-h/iot-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/arianna-h-h/iot-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/arianna-h-h/iot-api/contents/{+path}","compare_url":"https://api.github.com/repos/arianna-h-h/iot-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/arianna-h-h/iot-api/merges","archive_url":"https://api.github.com/repos/arianna-h-h/iot-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/arianna-h-h/iot-api/downloads","issues_url":"https://api.github.com/repos/arianna-h-h/iot-api/issues{/number}","pulls_url":"https://api.github.com/repos/arianna-h-h/iot-api/pulls{/number}","milestones_url":"https://api.github.com/repos/arianna-h-h/iot-api/milestones{/number}","notifications_url":"https://api.github.com/repos/arianna-h-h/iot-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/arianna-h-h/iot-api/labels{/name}","releases_url":"https://api.github.com/repos/arianna-h-h/iot-api/releases{/id}","deployments_url":"https://api.github.com/repos/arianna-h-h/iot-api/deployments","created_at":"2017-09-26T19:51:46Z","updated_at":"2017-09-26T19:51:57Z","pushed_at":"2017-09-29T20:21:22Z","git_url":"git://github.com/arianna-h-h/iot-api.git","ssh_url":"git@github.com:arianna-h-h/iot-api.git","clone_url":"https://github.com/arianna-h-h/iot-api.git","svn_url":"https://github.com/arianna-h-h/iot-api","homepage":null,"size":92,"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,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"arianna-h-h:develop","ref":"develop","sha":"a058491841b30c85f2382bb3b830d298dcd236b3","user":{"login":"arianna-h-h","id":21130217,"avatar_url":"https://avatars0.githubusercontent.com/u/21130217?v=4","gravatar_id":"","url":"https://api.github.com/users/arianna-h-h","html_url":"https://github.com/arianna-h-h","followers_url":"https://api.github.com/users/arianna-h-h/followers","following_url":"https://api.github.com/users/arianna-h-h/following{/other_user}","gists_url":"https://api.github.com/users/arianna-h-h/gists{/gist_id}","starred_url":"https://api.github.com/users/arianna-h-h/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arianna-h-h/subscriptions","organizations_url":"https://api.github.com/users/arianna-h-h/orgs","repos_url":"https://api.github.com/users/arianna-h-h/repos","events_url":"https://api.github.com/users/arianna-h-h/events{/privacy}","received_events_url":"https://api.github.com/users/arianna-h-h/received_events","type":"User","site_admin":false},"repo":{"id":104931041,"name":"iot-api","full_name":"arianna-h-h/iot-api","owner":{"login":"arianna-h-h","id":21130217,"avatar_url":"https://avatars0.githubusercontent.com/u/21130217?v=4","gravatar_id":"","url":"https://api.github.com/users/arianna-h-h","html_url":"https://github.com/arianna-h-h","followers_url":"https://api.github.com/users/arianna-h-h/followers","following_url":"https://api.github.com/users/arianna-h-h/following{/other_user}","gists_url":"https://api.github.com/users/arianna-h-h/gists{/gist_id}","starred_url":"https://api.github.com/users/arianna-h-h/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arianna-h-h/subscriptions","organizations_url":"https://api.github.com/users/arianna-h-h/orgs","repos_url":"https://api.github.com/users/arianna-h-h/repos","events_url":"https://api.github.com/users/arianna-h-h/events{/privacy}","received_events_url":"https://api.github.com/users/arianna-h-h/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/arianna-h-h/iot-api","description":null,"fork":false,"url":"https://api.github.com/repos/arianna-h-h/iot-api","forks_url":"https://api.github.com/repos/arianna-h-h/iot-api/forks","keys_url":"https://api.github.com/repos/arianna-h-h/iot-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/arianna-h-h/iot-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/arianna-h-h/iot-api/teams","hooks_url":"https://api.github.com/repos/arianna-h-h/iot-api/hooks","issue_events_url":"https://api.github.com/repos/arianna-h-h/iot-api/issues/events{/number}","events_url":"https://api.github.com/repos/arianna-h-h/iot-api/events","assignees_url":"https://api.github.com/repos/arianna-h-h/iot-api/assignees{/user}","branches_url":"https://api.github.com/repos/arianna-h-h/iot-api/branches{/branch}","tags_url":"https://api.github.com/repos/arianna-h-h/iot-api/tags","blobs_url":"https://api.github.com/repos/arianna-h-h/iot-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/arianna-h-h/iot-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/arianna-h-h/iot-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/arianna-h-h/iot-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/arianna-h-h/iot-api/statuses/{sha}","languages_url":"https://api.github.com/repos/arianna-h-h/iot-api/languages","stargazers_url":"https://api.github.com/repos/arianna-h-h/iot-api/stargazers","contributors_url":"https://api.github.com/repos/arianna-h-h/iot-api/contributors","subscribers_url":"https://api.github.com/repos/arianna-h-h/iot-api/subscribers","subscription_url":"https://api.github.com/repos/arianna-h-h/iot-api/subscription","commits_url":"https://api.github.com/repos/arianna-h-h/iot-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/arianna-h-h/iot-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/arianna-h-h/iot-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/arianna-h-h/iot-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/arianna-h-h/iot-api/contents/{+path}","compare_url":"https://api.github.com/repos/arianna-h-h/iot-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/arianna-h-h/iot-api/merges","archive_url":"https://api.github.com/repos/arianna-h-h/iot-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/arianna-h-h/iot-api/downloads","issues_url":"https://api.github.com/repos/arianna-h-h/iot-api/issues{/number}","pulls_url":"https://api.github.com/repos/arianna-h-h/iot-api/pulls{/number}","milestones_url":"https://api.github.com/repos/arianna-h-h/iot-api/milestones{/number}","notifications_url":"https://api.github.com/repos/arianna-h-h/iot-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/arianna-h-h/iot-api/labels{/name}","releases_url":"https://api.github.com/repos/arianna-h-h/iot-api/releases{/id}","deployments_url":"https://api.github.com/repos/arianna-h-h/iot-api/deployments","created_at":"2017-09-26T19:51:46Z","updated_at":"2017-09-26T19:51:57Z","pushed_at":"2017-09-29T20:21:22Z","git_url":"git://github.com/arianna-h-h/iot-api.git","ssh_url":"git@github.com:arianna-h-h/iot-api.git","clone_url":"https://github.com/arianna-h-h/iot-api.git","svn_url":"https://github.com/arianna-h-h/iot-api","homepage":null,"size":92,"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,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/arianna-h-h/iot-api/pulls/4"},"html":{"href":"https://github.com/arianna-h-h/iot-api/pull/4"},"issue":{"href":"https://api.github.com/repos/arianna-h-h/iot-api/issues/4"},"comments":{"href":"https://api.github.com/repos/arianna-h-h/iot-api/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/arianna-h-h/iot-api/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/arianna-h-h/iot-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/arianna-h-h/iot-api/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/arianna-h-h/iot-api/statuses/0a309f726f58002ce61f5f6878c75ec5e2b60868"}},"author_association":"OWNER"}}
{"actor":{"display_login":"arianna-h-h"}}