{"action":"created","comment":{"url":"https://api.github.com/repos/meetup/meetup-web-platform/pulls/comments/82252813","pull_request_review_id":3173604,"id":82252813,"diff_hunk":"@@ -0,0 +1,89 @@\n+import { Cookie } from 'tough-cookie';\n+import { Observable } from 'rxjs';\n+import Hapi from 'hapi';\n+import getRoutes from './routes';\n+import getConfig from './util/config';\n+\n+const server = new Hapi.Server();\n+\n+server.connection();\n+\n+// mock the anonAuthPlugin\n+server.decorate(\n+\t'request',\n+\t'authorize',\n+\trequest => () => Observable.of(request),\n+\t{ apply: true }\n+);\n+\n+const MOCK_RESULT = 'asdf';\n+const MOCK_RENDER_REQUEST = () => Observable.of({ result: MOCK_RESULT, statusCode: 200 });\n+\n+const MOCK_renderRequestMap = {\n+\t'en-US': MOCK_RENDER_REQUEST,\n+};\n+\n+const MOCK_OAUTH_COOKIES = {\n+\toauth_token: '1234',\n+\trefresh_token: 'asdf',\n+\tanonymous: true\n+};\n+\n+const MOCK_API_RESULT = {\n+\tqueries: [],\n+\tresponses: [],\n+};\n+\n+const serverReady = getConfig()\n+\t.then(config => getRoutes(MOCK_renderRequestMap, config, () => () => Observable.of(MOCK_API_RESULT)))\n+\t.then(server.route.bind(server));\n+\n+describe('routes', () => {\n+\tit('serves the homepage route', () =>\n+\t\tserverReady\n+\t\t\t.then(() => server.inject({ url: '/' }))\n+\t\t\t.then(response => expect(response.payload).toEqual(MOCK_RESULT))","path":"routes.test.js","position":45,"original_position":45,"commit_id":"b992c5afc4038b351441eb4f27b3180e702ce32c","original_commit_id":"b992c5afc4038b351441eb4f27b3180e702ce32c","user":{"login":"sadafie","id":1033572,"avatar_url":"https://avatars.githubusercontent.com/u/1033572?v=3","gravatar_id":"","url":"https://api.github.com/users/sadafie","html_url":"https://github.com/sadafie","followers_url":"https://api.github.com/users/sadafie/followers","following_url":"https://api.github.com/users/sadafie/following{/other_user}","gists_url":"https://api.github.com/users/sadafie/gists{/gist_id}","starred_url":"https://api.github.com/users/sadafie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sadafie/subscriptions","organizations_url":"https://api.github.com/users/sadafie/orgs","repos_url":"https://api.github.com/users/sadafie/repos","events_url":"https://api.github.com/users/sadafie/events{/privacy}","received_events_url":"https://api.github.com/users/sadafie/received_events","type":"User","site_admin":false},"body":"Yep, went back and looked the hapi docs. thanks!","created_at":"2016-10-06T18:26:15Z","updated_at":"2016-10-06T18:26:15Z","html_url":"https://github.com/meetup/meetup-web-platform/pull/19#discussion_r82252813","pull_request_url":"https://api.github.com/repos/meetup/meetup-web-platform/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/meetup/meetup-web-platform/pulls/comments/82252813"},"html":{"href":"https://github.com/meetup/meetup-web-platform/pull/19#discussion_r82252813"},"pull_request":{"href":"https://api.github.com/repos/meetup/meetup-web-platform/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/meetup/meetup-web-platform/pulls/19","id":88181163,"html_url":"https://github.com/meetup/meetup-web-platform/pull/19","diff_url":"https://github.com/meetup/meetup-web-platform/pull/19.diff","patch_url":"https://github.com/meetup/meetup-web-platform/pull/19.patch","issue_url":"https://api.github.com/repos/meetup/meetup-web-platform/issues/19","number":19,"state":"open","locked":false,"title":"Unit tests for routes","user":{"login":"mmcgahan","id":1885153,"avatar_url":"https://avatars.githubusercontent.com/u/1885153?v=3","gravatar_id":"","url":"https://api.github.com/users/mmcgahan","html_url":"https://github.com/mmcgahan","followers_url":"https://api.github.com/users/mmcgahan/followers","following_url":"https://api.github.com/users/mmcgahan/following{/other_user}","gists_url":"https://api.github.com/users/mmcgahan/gists{/gist_id}","starred_url":"https://api.github.com/users/mmcgahan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmcgahan/subscriptions","organizations_url":"https://api.github.com/users/mmcgahan/orgs","repos_url":"https://api.github.com/users/mmcgahan/repos","events_url":"https://api.github.com/users/mmcgahan/events{/privacy}","received_events_url":"https://api.github.com/users/mmcgahan/received_events","type":"User","site_admin":false},"body":"The meetup-web-platform `routes.js` was almost completely untested, and requires mocking a Hapi request using `server.inject`, which we haven't done before.\r\n\r\nI went ahead and set up some basic tests that greatly increase test coverage, but there's more to do.\r\n\r\n@sadafie it would be good to add some tests for `initTrackingCookie`\r\n\r\n`Prelim` until I can review everything and add some documentation. Lots of opportunities for refactoring into more testable units...","created_at":"2016-10-06T00:28:47Z","updated_at":"2016-10-06T18:26:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ed565c641f8586d2dee0b94ba392a687982c2563","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/meetup/meetup-web-platform/pulls/19/commits","review_comments_url":"https://api.github.com/repos/meetup/meetup-web-platform/pulls/19/comments","review_comment_url":"https://api.github.com/repos/meetup/meetup-web-platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/meetup/meetup-web-platform/issues/19/comments","statuses_url":"https://api.github.com/repos/meetup/meetup-web-platform/statuses/b992c5afc4038b351441eb4f27b3180e702ce32c","head":{"label":"meetup:routes-tests","ref":"routes-tests","sha":"b992c5afc4038b351441eb4f27b3180e702ce32c","user":{"login":"meetup","id":147855,"avatar_url":"https://avatars.githubusercontent.com/u/147855?v=3","gravatar_id":"","url":"https://api.github.com/users/meetup","html_url":"https://github.com/meetup","followers_url":"https://api.github.com/users/meetup/followers","following_url":"https://api.github.com/users/meetup/following{/other_user}","gists_url":"https://api.github.com/users/meetup/gists{/gist_id}","starred_url":"https://api.github.com/users/meetup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meetup/subscriptions","organizations_url":"https://api.github.com/users/meetup/orgs","repos_url":"https://api.github.com/users/meetup/repos","events_url":"https://api.github.com/users/meetup/events{/privacy}","received_events_url":"https://api.github.com/users/meetup/received_events","type":"Organization","site_admin":false},"repo":{"id":66412742,"name":"meetup-web-platform","full_name":"meetup/meetup-web-platform","owner":{"login":"meetup","id":147855,"avatar_url":"https://avatars.githubusercontent.com/u/147855?v=3","gravatar_id":"","url":"https://api.github.com/users/meetup","html_url":"https://github.com/meetup","followers_url":"https://api.github.com/users/meetup/followers","following_url":"https://api.github.com/users/meetup/following{/other_user}","gists_url":"https://api.github.com/users/meetup/gists{/gist_id}","starred_url":"https://api.github.com/users/meetup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meetup/subscriptions","organizations_url":"https://api.github.com/users/meetup/orgs","repos_url":"https://api.github.com/users/meetup/repos","events_url":"https://api.github.com/users/meetup/events{/privacy}","received_events_url":"https://api.github.com/users/meetup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/meetup/meetup-web-platform","description":"A collection of Node web application utilities developed for the Meetup web platform","fork":false,"url":"https://api.github.com/repos/meetup/meetup-web-platform","forks_url":"https://api.github.com/repos/meetup/meetup-web-platform/forks","keys_url":"https://api.github.com/repos/meetup/meetup-web-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/meetup/meetup-web-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/meetup/meetup-web-platform/teams","hooks_url":"https://api.github.com/repos/meetup/meetup-web-platform/hooks","issue_events_url":"https://api.github.com/repos/meetup/meetup-web-platform/issues/events{/number}","events_url":"https://api.github.com/repos/meetup/meetup-web-platform/events","assignees_url":"https://api.github.com/repos/meetup/meetup-web-platform/assignees{/user}","branches_url":"https://api.github.com/repos/meetup/meetup-web-platform/branches{/branch}","tags_url":"https://api.github.com/repos/meetup/meetup-web-platform/tags","blobs_url":"https://api.github.com/repos/meetup/meetup-web-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/meetup/meetup-web-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/meetup/meetup-web-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/meetup/meetup-web-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/meetup/meetup-web-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/meetup/meetup-web-platform/languages","stargazers_url":"https://api.github.com/repos/meetup/meetup-web-platform/stargazers","contributors_url":"https://api.github.com/repos/meetup/meetup-web-platform/contributors","subscribers_url":"https://api.github.com/repos/meetup/meetup-web-platform/subscribers","subscription_url":"https://api.github.com/repos/meetup/meetup-web-platform/subscription","commits_url":"https://api.github.com/repos/meetup/meetup-web-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/meetup/meetup-web-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/meetup/meetup-web-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/meetup/meetup-web-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/meetup/meetup-web-platform/contents/{+path}","compare_url":"https://api.github.com/repos/meetup/meetup-web-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/meetup/meetup-web-platform/merges","archive_url":"https://api.github.com/repos/meetup/meetup-web-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/meetup/meetup-web-platform/downloads","issues_url":"https://api.github.com/repos/meetup/meetup-web-platform/issues{/number}","pulls_url":"https://api.github.com/repos/meetup/meetup-web-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/meetup/meetup-web-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/meetup/meetup-web-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/meetup/meetup-web-platform/labels{/name}","releases_url":"https://api.github.com/repos/meetup/meetup-web-platform/releases{/id}","deployments_url":"https://api.github.com/repos/meetup/meetup-web-platform/deployments","created_at":"2016-08-23T23:59:22Z","updated_at":"2016-10-02T09:27:10Z","pushed_at":"2016-10-06T18:24:08Z","git_url":"git://github.com/meetup/meetup-web-platform.git","ssh_url":"git@github.com:meetup/meetup-web-platform.git","clone_url":"https://github.com/meetup/meetup-web-platform.git","svn_url":"https://github.com/meetup/meetup-web-platform","homepage":null,"size":267,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":2,"default_branch":"master"}},"base":{"label":"meetup:master","ref":"master","sha":"7002a76c16fff6327a7876302fb48daae0b572e5","user":{"login":"meetup","id":147855,"avatar_url":"https://avatars.githubusercontent.com/u/147855?v=3","gravatar_id":"","url":"https://api.github.com/users/meetup","html_url":"https://github.com/meetup","followers_url":"https://api.github.com/users/meetup/followers","following_url":"https://api.github.com/users/meetup/following{/other_user}","gists_url":"https://api.github.com/users/meetup/gists{/gist_id}","starred_url":"https://api.github.com/users/meetup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meetup/subscriptions","organizations_url":"https://api.github.com/users/meetup/orgs","repos_url":"https://api.github.com/users/meetup/repos","events_url":"https://api.github.com/users/meetup/events{/privacy}","received_events_url":"https://api.github.com/users/meetup/received_events","type":"Organization","site_admin":false},"repo":{"id":66412742,"name":"meetup-web-platform","full_name":"meetup/meetup-web-platform","owner":{"login":"meetup","id":147855,"avatar_url":"https://avatars.githubusercontent.com/u/147855?v=3","gravatar_id":"","url":"https://api.github.com/users/meetup","html_url":"https://github.com/meetup","followers_url":"https://api.github.com/users/meetup/followers","following_url":"https://api.github.com/users/meetup/following{/other_user}","gists_url":"https://api.github.com/users/meetup/gists{/gist_id}","starred_url":"https://api.github.com/users/meetup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meetup/subscriptions","organizations_url":"https://api.github.com/users/meetup/orgs","repos_url":"https://api.github.com/users/meetup/repos","events_url":"https://api.github.com/users/meetup/events{/privacy}","received_events_url":"https://api.github.com/users/meetup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/meetup/meetup-web-platform","description":"A collection of Node web application utilities developed for the Meetup web platform","fork":false,"url":"https://api.github.com/repos/meetup/meetup-web-platform","forks_url":"https://api.github.com/repos/meetup/meetup-web-platform/forks","keys_url":"https://api.github.com/repos/meetup/meetup-web-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/meetup/meetup-web-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/meetup/meetup-web-platform/teams","hooks_url":"https://api.github.com/repos/meetup/meetup-web-platform/hooks","issue_events_url":"https://api.github.com/repos/meetup/meetup-web-platform/issues/events{/number}","events_url":"https://api.github.com/repos/meetup/meetup-web-platform/events","assignees_url":"https://api.github.com/repos/meetup/meetup-web-platform/assignees{/user}","branches_url":"https://api.github.com/repos/meetup/meetup-web-platform/branches{/branch}","tags_url":"https://api.github.com/repos/meetup/meetup-web-platform/tags","blobs_url":"https://api.github.com/repos/meetup/meetup-web-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/meetup/meetup-web-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/meetup/meetup-web-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/meetup/meetup-web-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/meetup/meetup-web-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/meetup/meetup-web-platform/languages","stargazers_url":"https://api.github.com/repos/meetup/meetup-web-platform/stargazers","contributors_url":"https://api.github.com/repos/meetup/meetup-web-platform/contributors","subscribers_url":"https://api.github.com/repos/meetup/meetup-web-platform/subscribers","subscription_url":"https://api.github.com/repos/meetup/meetup-web-platform/subscription","commits_url":"https://api.github.com/repos/meetup/meetup-web-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/meetup/meetup-web-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/meetup/meetup-web-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/meetup/meetup-web-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/meetup/meetup-web-platform/contents/{+path}","compare_url":"https://api.github.com/repos/meetup/meetup-web-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/meetup/meetup-web-platform/merges","archive_url":"https://api.github.com/repos/meetup/meetup-web-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/meetup/meetup-web-platform/downloads","issues_url":"https://api.github.com/repos/meetup/meetup-web-platform/issues{/number}","pulls_url":"https://api.github.com/repos/meetup/meetup-web-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/meetup/meetup-web-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/meetup/meetup-web-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/meetup/meetup-web-platform/labels{/name}","releases_url":"https://api.github.com/repos/meetup/meetup-web-platform/releases{/id}","deployments_url":"https://api.github.com/repos/meetup/meetup-web-platform/deployments","created_at":"2016-08-23T23:59:22Z","updated_at":"2016-10-02T09:27:10Z","pushed_at":"2016-10-06T18:24:08Z","git_url":"git://github.com/meetup/meetup-web-platform.git","ssh_url":"git@github.com:meetup/meetup-web-platform.git","clone_url":"https://github.com/meetup/meetup-web-platform.git","svn_url":"https://github.com/meetup/meetup-web-platform","homepage":null,"size":267,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/meetup/meetup-web-platform/pulls/19"},"html":{"href":"https://github.com/meetup/meetup-web-platform/pull/19"},"issue":{"href":"https://api.github.com/repos/meetup/meetup-web-platform/issues/19"},"comments":{"href":"https://api.github.com/repos/meetup/meetup-web-platform/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/meetup/meetup-web-platform/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/meetup/meetup-web-platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/meetup/meetup-web-platform/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/meetup/meetup-web-platform/statuses/b992c5afc4038b351441eb4f27b3180e702ce32c"}}}}
{"actor":{"display_login":"sadafie"}}