{"action":"created","comment":{"url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/pulls/comments/82476874","pull_request_review_id":3385405,"id":82476874,"diff_hunk":"@@ -0,0 +1,161 @@\n+'use strict';\n+\n+import {expressHandler, initAppAndPrepareDb} from 'tests/server/integration/utils';\n+import request from 'supertest-as-promised';\n+import logger from 'winston';\n+\n+import {getApp} from 'server/app';\n+import {GroceryListDao} from 'server/api/grocery_list/GroceryListDao';\n+\n+const mainUrl = '/api/grocery_list';\n+const listUrl = `${mainUrl}/{list_id}`;\n+const itemsUrl = `${listUrl}/items`;\n+const itemUrl = `${itemsUrl}/{item_id}`;\n+\n+class Helpers {\n+  constructor(dao, eh) {\n+    this.dao = dao;\n+    this.eh = eh;\n+  }\n+\n+  insertNew() {\n+    return this.dao.insert(GroceryListDao.create(this.getRandomString(), false)).then(d => d._id);\n+  }\n+\n+  /* returns Promise which resolves to list of inserted documents */\n+  insertLists() {\n+    return Promise.all([1,2,3].map(_ => this.insertNew()));\n+  }\n+\n+  /* @todo: fix lack of title\n+   * returns Promise, which resolves to id of the posted document */\n+  postNew() {\n+    return request(this.eh)\n+      .post(mainUrl)\n+      .set('Content-Type', 'application/json')\n+      .send({title: this.getRandomString(), completed: false})\n+      .expect(201)\n+      .then(response => response.body._id);\n+  }\n+\n+  getRandomString() {\n+    return Math.random().toString(36).substr(0, 8);\n+  }\n+}\n+\n+const suiteName = 'Grocer List API';\n+var eh;\n+var dao;\n+var helpers;\n+\n+/* problem - if one fails, everything goes down the drain... */\n+\n+initAppAndPrepareDb()\n+  /* setup needed for all tests */\n+  .then((app) => {\n+    eh = app.getExpressHandler();\n+    dao = new GroceryListDao(app.getDatabase());\n+    helpers = new Helpers(dao, eh);\n+  })\n+  /* T1: let's insert lists tht we'll want to retrieve */\n+  .then(() => helpers.insertLists())\n+  /* T1: now we have to make request */\n+  .then((insertedIds) => {\n+    return request(eh)\n+      .get(mainUrl)\n+      .set('Content-Type', 'application/json')\n+      .expect(200)\n+      .then(resp => ({insertedIds, rBody: resp.body}));\n+  })\n+  /* T1: verification step */\n+  .then(({insertedIds, rBody}) => {\n+    describe(`${suiteName}: GET ${mainUrl}`, () => {\n+      it('should return all lists', () => {\n+        expect(rBody.map(gl => gl._id)).to.deep.include.members(insertedIds);\n+      });\n+    })\n+  })\n+  /* T2: we're gonna test posting, so database needs to be cleaned first */\n+  .then(() => dao.clean())\n+  .then(() => helpers.postNew())\n+  .then((id) => {\n+    describe(`${suiteName}: POST ${mainUrl}`, () => {\n+      it('should create new grocery list', () => {\n+        return dao.getOne(id)\n+          .then(list => expect(list).to.be.not.null);\n+      });\n+    });\n+  })\n+  /* T3: */\n+  .then(() => helpers.insertNew())\n+  .then(id => {\n+    describe(`${suiteName}: GET ${listUrl}`, () => {\n+      it('should return item with given id', () => {\n+        return request(eh)\n+          .get(listUrl.replace('{list_id}', id))\n+          .set('Content-Type', 'application/json')\n+          .expect(200)\n+          .then(res => expect(res.body._id).to.be.equal(id));\n+      });\n+    });\n+  })\n+  /* T4 */\n+  .then(() => helpers.insertNew())\n+  .then((id) => {\n+    const newTitle = 'new_title';\n+\n+    return request(eh)\n+      .patch(listUrl.replace('{list_id}', id))\n+      .set('Content-Type', 'application/json')\n+      .send({title: newTitle})\n+      .expect(204)\n+      .then(_ => dao.getOne(id))\n+      .then(list => ({newTitle, list}));\n+  })\n+  .then(({newTitle, list}) => {\n+    describe(`${suiteName}: PATCH ${listUrl}`, () => {\n+      it('should modify list name', () => {\n+        expect(list.title).to.be.equal(newTitle);\n+      });\n+    });\n+  })\n+  /* T5 */\n+  .then(() => helpers.insertNew())\n+  .then((id) => {\n+    return request(eh)\n+      .delete(listUrl.replace('{list_id}', id))\n+      .set('Content-Type', 'application/json')\n+      .expect(204)\n+      .then(_ => dao.getOne(id))\n+      .catch(() => null)\n+  })\n+  .then(list => {","path":"src/node_modules/tests/server/integration/api/grocery_list/grocery_list.integration.js","position":132,"original_position":132,"commit_id":"525d6e8e71712e901101144fe883395377edd085","original_commit_id":"525d6e8e71712e901101144fe883395377edd085","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","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 parentheses around arrow function argument having a body with curly braces  arrow-parens","created_at":"2016-10-07T21:55:34Z","updated_at":"2016-10-07T21:55:34Z","html_url":"https://github.com/DancingMonkeyTeam/bitetracker/pull/7#discussion_r82476874","pull_request_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/pulls/comments/82476874"},"html":{"href":"https://github.com/DancingMonkeyTeam/bitetracker/pull/7#discussion_r82476874"},"pull_request":{"href":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/pulls/7","id":86772369,"html_url":"https://github.com/DancingMonkeyTeam/bitetracker/pull/7","diff_url":"https://github.com/DancingMonkeyTeam/bitetracker/pull/7.diff","patch_url":"https://github.com/DancingMonkeyTeam/bitetracker/pull/7.patch","issue_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/issues/7","number":7,"state":"open","locked":false,"title":"Grocery lists backend","user":{"login":"BlueEyedHush","id":5757040,"avatar_url":"https://avatars.githubusercontent.com/u/5757040?v=3","gravatar_id":"","url":"https://api.github.com/users/BlueEyedHush","html_url":"https://github.com/BlueEyedHush","followers_url":"https://api.github.com/users/BlueEyedHush/followers","following_url":"https://api.github.com/users/BlueEyedHush/following{/other_user}","gists_url":"https://api.github.com/users/BlueEyedHush/gists{/gist_id}","starred_url":"https://api.github.com/users/BlueEyedHush/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlueEyedHush/subscriptions","organizations_url":"https://api.github.com/users/BlueEyedHush/orgs","repos_url":"https://api.github.com/users/BlueEyedHush/repos","events_url":"https://api.github.com/users/BlueEyedHush/events{/privacy}","received_events_url":"https://api.github.com/users/BlueEyedHush/received_events","type":"User","site_admin":false},"body":"Still work in progress, but I think that the general shape is there - so you can look it through if you are really interested.","created_at":"2016-09-26T16:10:42Z","updated_at":"2016-10-07T21:55:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"41da81f94c434ea7868b83de6d69eac961d4d861","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/pulls/7/commits","review_comments_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/pulls/7/comments","review_comment_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/issues/7/comments","statuses_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/statuses/525d6e8e71712e901101144fe883395377edd085","head":{"label":"DancingMonkeyTeam:feature-grocery_lists_backend","ref":"feature-grocery_lists_backend","sha":"525d6e8e71712e901101144fe883395377edd085","user":{"login":"DancingMonkeyTeam","id":18415404,"avatar_url":"https://avatars.githubusercontent.com/u/18415404?v=3","gravatar_id":"","url":"https://api.github.com/users/DancingMonkeyTeam","html_url":"https://github.com/DancingMonkeyTeam","followers_url":"https://api.github.com/users/DancingMonkeyTeam/followers","following_url":"https://api.github.com/users/DancingMonkeyTeam/following{/other_user}","gists_url":"https://api.github.com/users/DancingMonkeyTeam/gists{/gist_id}","starred_url":"https://api.github.com/users/DancingMonkeyTeam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DancingMonkeyTeam/subscriptions","organizations_url":"https://api.github.com/users/DancingMonkeyTeam/orgs","repos_url":"https://api.github.com/users/DancingMonkeyTeam/repos","events_url":"https://api.github.com/users/DancingMonkeyTeam/events{/privacy}","received_events_url":"https://api.github.com/users/DancingMonkeyTeam/received_events","type":"Organization","site_admin":false},"repo":{"id":56049664,"name":"bitetracker","full_name":"DancingMonkeyTeam/bitetracker","owner":{"login":"DancingMonkeyTeam","id":18415404,"avatar_url":"https://avatars.githubusercontent.com/u/18415404?v=3","gravatar_id":"","url":"https://api.github.com/users/DancingMonkeyTeam","html_url":"https://github.com/DancingMonkeyTeam","followers_url":"https://api.github.com/users/DancingMonkeyTeam/followers","following_url":"https://api.github.com/users/DancingMonkeyTeam/following{/other_user}","gists_url":"https://api.github.com/users/DancingMonkeyTeam/gists{/gist_id}","starred_url":"https://api.github.com/users/DancingMonkeyTeam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DancingMonkeyTeam/subscriptions","organizations_url":"https://api.github.com/users/DancingMonkeyTeam/orgs","repos_url":"https://api.github.com/users/DancingMonkeyTeam/repos","events_url":"https://api.github.com/users/DancingMonkeyTeam/events{/privacy}","received_events_url":"https://api.github.com/users/DancingMonkeyTeam/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DancingMonkeyTeam/bitetracker","description":"","fork":false,"url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker","forks_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/forks","keys_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/teams","hooks_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/hooks","issue_events_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/issues/events{/number}","events_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/events","assignees_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/assignees{/user}","branches_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/branches{/branch}","tags_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/tags","blobs_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/git/refs{/sha}","trees_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/statuses/{sha}","languages_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/languages","stargazers_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/stargazers","contributors_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/contributors","subscribers_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/subscribers","subscription_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/subscription","commits_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/commits{/sha}","git_commits_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/git/commits{/sha}","comments_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/comments{/number}","issue_comment_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/issues/comments{/number}","contents_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/contents/{+path}","compare_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/merges","archive_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/downloads","issues_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/issues{/number}","pulls_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/pulls{/number}","milestones_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/milestones{/number}","notifications_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/labels{/name}","releases_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/releases{/id}","deployments_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/deployments","created_at":"2016-04-12T09:29:58Z","updated_at":"2016-04-12T09:30:34Z","pushed_at":"2016-10-07T21:55:16Z","git_url":"git://github.com/DancingMonkeyTeam/bitetracker.git","ssh_url":"git@github.com:DancingMonkeyTeam/bitetracker.git","clone_url":"https://github.com/DancingMonkeyTeam/bitetracker.git","svn_url":"https://github.com/DancingMonkeyTeam/bitetracker","homepage":null,"size":21625,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"DancingMonkeyTeam:master","ref":"master","sha":"5096cf92ee020cdc3d2812c20e38bd4f4c6bd8bb","user":{"login":"DancingMonkeyTeam","id":18415404,"avatar_url":"https://avatars.githubusercontent.com/u/18415404?v=3","gravatar_id":"","url":"https://api.github.com/users/DancingMonkeyTeam","html_url":"https://github.com/DancingMonkeyTeam","followers_url":"https://api.github.com/users/DancingMonkeyTeam/followers","following_url":"https://api.github.com/users/DancingMonkeyTeam/following{/other_user}","gists_url":"https://api.github.com/users/DancingMonkeyTeam/gists{/gist_id}","starred_url":"https://api.github.com/users/DancingMonkeyTeam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DancingMonkeyTeam/subscriptions","organizations_url":"https://api.github.com/users/DancingMonkeyTeam/orgs","repos_url":"https://api.github.com/users/DancingMonkeyTeam/repos","events_url":"https://api.github.com/users/DancingMonkeyTeam/events{/privacy}","received_events_url":"https://api.github.com/users/DancingMonkeyTeam/received_events","type":"Organization","site_admin":false},"repo":{"id":56049664,"name":"bitetracker","full_name":"DancingMonkeyTeam/bitetracker","owner":{"login":"DancingMonkeyTeam","id":18415404,"avatar_url":"https://avatars.githubusercontent.com/u/18415404?v=3","gravatar_id":"","url":"https://api.github.com/users/DancingMonkeyTeam","html_url":"https://github.com/DancingMonkeyTeam","followers_url":"https://api.github.com/users/DancingMonkeyTeam/followers","following_url":"https://api.github.com/users/DancingMonkeyTeam/following{/other_user}","gists_url":"https://api.github.com/users/DancingMonkeyTeam/gists{/gist_id}","starred_url":"https://api.github.com/users/DancingMonkeyTeam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DancingMonkeyTeam/subscriptions","organizations_url":"https://api.github.com/users/DancingMonkeyTeam/orgs","repos_url":"https://api.github.com/users/DancingMonkeyTeam/repos","events_url":"https://api.github.com/users/DancingMonkeyTeam/events{/privacy}","received_events_url":"https://api.github.com/users/DancingMonkeyTeam/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DancingMonkeyTeam/bitetracker","description":"","fork":false,"url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker","forks_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/forks","keys_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/teams","hooks_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/hooks","issue_events_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/issues/events{/number}","events_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/events","assignees_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/assignees{/user}","branches_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/branches{/branch}","tags_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/tags","blobs_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/git/refs{/sha}","trees_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/statuses/{sha}","languages_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/languages","stargazers_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/stargazers","contributors_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/contributors","subscribers_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/subscribers","subscription_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/subscription","commits_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/commits{/sha}","git_commits_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/git/commits{/sha}","comments_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/comments{/number}","issue_comment_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/issues/comments{/number}","contents_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/contents/{+path}","compare_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/merges","archive_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/downloads","issues_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/issues{/number}","pulls_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/pulls{/number}","milestones_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/milestones{/number}","notifications_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/labels{/name}","releases_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/releases{/id}","deployments_url":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/deployments","created_at":"2016-04-12T09:29:58Z","updated_at":"2016-04-12T09:30:34Z","pushed_at":"2016-10-07T21:55:16Z","git_url":"git://github.com/DancingMonkeyTeam/bitetracker.git","ssh_url":"git@github.com:DancingMonkeyTeam/bitetracker.git","clone_url":"https://github.com/DancingMonkeyTeam/bitetracker.git","svn_url":"https://github.com/DancingMonkeyTeam/bitetracker","homepage":null,"size":21625,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/pulls/7"},"html":{"href":"https://github.com/DancingMonkeyTeam/bitetracker/pull/7"},"issue":{"href":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/issues/7"},"comments":{"href":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/DancingMonkeyTeam/bitetracker/statuses/525d6e8e71712e901101144fe883395377edd085"}}}}
{"actor":{"display_login":"houndci-bot"}}