{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-services/loop-server/pulls/comments/54086295","id":54086295,"diff_hunk":"@@ -1720,6 +1723,99 @@ function runOnPrefix(apiPrefix) {\n           });\n       });\n     });\n+\n+    describe(\"POST /event\", function() {\n+      it(\"should fail if does not have event/label/action.\", function(done) {\n+          supertest(app)\n+            .post('/event')\n+            .type('json')\n+            .expect('Content-Type', /json/)\n+            .expect(400)\n+            .end(function(err, res) {\n+              if (err) throw err;\n+              expectFormattedError(res, 400, errors.MISSING_PARAMETERS,\n+                                   \"Missing: event, action, label\");\n+              done();\n+            });\n+        });\n+\n+      it(\"should returns a 401 if no hawk session.\", function(done) {\n+          supertest(app)\n+            .post('/event')\n+            .type('json')\n+            .expect('Content-Type', /json/)\n+            .send({'event': 'tab_shared',\n+                   'action': 'clicked',\n+                   'label': 'Tab shared'})\n+            .expect(401)\n+            .end(done);\n+        });\n+\n+      it(\"should returns a 405 if disabled in settings.\", function(done) {\n+          supertest(app)\n+            .post('/event')\n+            .type('json')\n+            .expect('Content-Type', /json/)\n+            .send({'event': 'tab_shared',\n+                   'action': 'clicked',\n+                   'label': 'Tab shared'})\n+            .hawk(hawkCredentials)\n+            .expect(405)\n+            .end(done);\n+        });\n+\n+      context(\"enabled\", function() {\n+        var sendAnalyticsStub;\n+        beforeEach(function() {\n+          // XXX: stup node-analytics","path":"test/functional_test.js","position":69,"original_position":69,"commit_id":"293a4272453908d382c1a29af8b198daee0678d4","original_commit_id":"293a4272453908d382c1a29af8b198daee0678d4","user":{"login":"n1k0","id":41547,"avatar_url":"https://avatars.githubusercontent.com/u/41547?v=3","gravatar_id":"","url":"https://api.github.com/users/n1k0","html_url":"https://github.com/n1k0","followers_url":"https://api.github.com/users/n1k0/followers","following_url":"https://api.github.com/users/n1k0/following{/other_user}","gists_url":"https://api.github.com/users/n1k0/gists{/gist_id}","starred_url":"https://api.github.com/users/n1k0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n1k0/subscriptions","organizations_url":"https://api.github.com/users/n1k0/orgs","repos_url":"https://api.github.com/users/n1k0/repos","events_url":"https://api.github.com/users/n1k0/events{/privacy}","received_events_url":"https://api.github.com/users/n1k0/received_events","type":"User","site_admin":false},"body":"This can be removed.","created_at":"2016-02-25T12:10:35Z","updated_at":"2016-02-25T12:10:35Z","html_url":"https://github.com/mozilla-services/loop-server/pull/366#discussion_r54086295","pull_request_url":"https://api.github.com/repos/mozilla-services/loop-server/pulls/366","_links":{"self":{"href":"https://api.github.com/repos/mozilla-services/loop-server/pulls/comments/54086295"},"html":{"href":"https://github.com/mozilla-services/loop-server/pull/366#discussion_r54086295"},"pull_request":{"href":"https://api.github.com/repos/mozilla-services/loop-server/pulls/366"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-services/loop-server/pulls/366","id":60337459,"html_url":"https://github.com/mozilla-services/loop-server/pull/366","diff_url":"https://github.com/mozilla-services/loop-server/pull/366.diff","patch_url":"https://github.com/mozilla-services/loop-server/pull/366.patch","issue_url":"https://api.github.com/repos/mozilla-services/loop-server/issues/366","number":366,"state":"open","locked":false,"title":"Bug 1243393 — Add an event route","user":{"login":"Natim","id":229453,"avatar_url":"https://avatars.githubusercontent.com/u/229453?v=3","gravatar_id":"","url":"https://api.github.com/users/Natim","html_url":"https://github.com/Natim","followers_url":"https://api.github.com/users/Natim/followers","following_url":"https://api.github.com/users/Natim/following{/other_user}","gists_url":"https://api.github.com/users/Natim/gists{/gist_id}","starred_url":"https://api.github.com/users/Natim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Natim/subscriptions","organizations_url":"https://api.github.com/users/Natim/orgs","repos_url":"https://api.github.com/users/Natim/repos","events_url":"https://api.github.com/users/Natim/events{/privacy}","received_events_url":"https://api.github.com/users/Natim/received_events","type":"User","site_admin":false},"body":"https://bugzilla.mozilla.org/show_bug.cgi?id=1243393","created_at":"2016-02-23T13:13:37Z","updated_at":"2016-02-25T12:10:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dab0384b78659f51e527cfcfd8f7220f9c9aaa1d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-services/loop-server/pulls/366/commits","review_comments_url":"https://api.github.com/repos/mozilla-services/loop-server/pulls/366/comments","review_comment_url":"https://api.github.com/repos/mozilla-services/loop-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla-services/loop-server/issues/366/comments","statuses_url":"https://api.github.com/repos/mozilla-services/loop-server/statuses/293a4272453908d382c1a29af8b198daee0678d4","head":{"label":"mozilla-services:1243393-add-a-GA-route","ref":"1243393-add-a-GA-route","sha":"293a4272453908d382c1a29af8b198daee0678d4","user":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"repo":{"id":17026140,"name":"loop-server","full_name":"mozilla-services/loop-server","owner":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-services/loop-server","description":"The mozilla loop server","fork":false,"url":"https://api.github.com/repos/mozilla-services/loop-server","forks_url":"https://api.github.com/repos/mozilla-services/loop-server/forks","keys_url":"https://api.github.com/repos/mozilla-services/loop-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-services/loop-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-services/loop-server/teams","hooks_url":"https://api.github.com/repos/mozilla-services/loop-server/hooks","issue_events_url":"https://api.github.com/repos/mozilla-services/loop-server/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-services/loop-server/events","assignees_url":"https://api.github.com/repos/mozilla-services/loop-server/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-services/loop-server/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-services/loop-server/tags","blobs_url":"https://api.github.com/repos/mozilla-services/loop-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-services/loop-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-services/loop-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-services/loop-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-services/loop-server/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-services/loop-server/languages","stargazers_url":"https://api.github.com/repos/mozilla-services/loop-server/stargazers","contributors_url":"https://api.github.com/repos/mozilla-services/loop-server/contributors","subscribers_url":"https://api.github.com/repos/mozilla-services/loop-server/subscribers","subscription_url":"https://api.github.com/repos/mozilla-services/loop-server/subscription","commits_url":"https://api.github.com/repos/mozilla-services/loop-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-services/loop-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-services/loop-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-services/loop-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-services/loop-server/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-services/loop-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-services/loop-server/merges","archive_url":"https://api.github.com/repos/mozilla-services/loop-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-services/loop-server/downloads","issues_url":"https://api.github.com/repos/mozilla-services/loop-server/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-services/loop-server/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-services/loop-server/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-services/loop-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-services/loop-server/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-services/loop-server/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla-services/loop-server/deployments","created_at":"2014-02-20T16:02:00Z","updated_at":"2016-02-24T21:23:05Z","pushed_at":"2016-02-25T09:26:47Z","git_url":"git://github.com/mozilla-services/loop-server.git","ssh_url":"git@github.com:mozilla-services/loop-server.git","clone_url":"https://github.com/mozilla-services/loop-server.git","svn_url":"https://github.com/mozilla-services/loop-server","homepage":"https://docs.services.mozilla.com/loop/apis.html","size":1985,"stargazers_count":51,"watchers_count":51,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":4,"forks":20,"open_issues":4,"watchers":51,"default_branch":"master"}},"base":{"label":"mozilla-services:master","ref":"master","sha":"f27e2dc7e4f7c29f01207dcef9049d75eb2a2684","user":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"repo":{"id":17026140,"name":"loop-server","full_name":"mozilla-services/loop-server","owner":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-services/loop-server","description":"The mozilla loop server","fork":false,"url":"https://api.github.com/repos/mozilla-services/loop-server","forks_url":"https://api.github.com/repos/mozilla-services/loop-server/forks","keys_url":"https://api.github.com/repos/mozilla-services/loop-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-services/loop-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-services/loop-server/teams","hooks_url":"https://api.github.com/repos/mozilla-services/loop-server/hooks","issue_events_url":"https://api.github.com/repos/mozilla-services/loop-server/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-services/loop-server/events","assignees_url":"https://api.github.com/repos/mozilla-services/loop-server/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-services/loop-server/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-services/loop-server/tags","blobs_url":"https://api.github.com/repos/mozilla-services/loop-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-services/loop-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-services/loop-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-services/loop-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-services/loop-server/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-services/loop-server/languages","stargazers_url":"https://api.github.com/repos/mozilla-services/loop-server/stargazers","contributors_url":"https://api.github.com/repos/mozilla-services/loop-server/contributors","subscribers_url":"https://api.github.com/repos/mozilla-services/loop-server/subscribers","subscription_url":"https://api.github.com/repos/mozilla-services/loop-server/subscription","commits_url":"https://api.github.com/repos/mozilla-services/loop-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-services/loop-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-services/loop-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-services/loop-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-services/loop-server/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-services/loop-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-services/loop-server/merges","archive_url":"https://api.github.com/repos/mozilla-services/loop-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-services/loop-server/downloads","issues_url":"https://api.github.com/repos/mozilla-services/loop-server/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-services/loop-server/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-services/loop-server/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-services/loop-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-services/loop-server/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-services/loop-server/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla-services/loop-server/deployments","created_at":"2014-02-20T16:02:00Z","updated_at":"2016-02-24T21:23:05Z","pushed_at":"2016-02-25T09:26:47Z","git_url":"git://github.com/mozilla-services/loop-server.git","ssh_url":"git@github.com:mozilla-services/loop-server.git","clone_url":"https://github.com/mozilla-services/loop-server.git","svn_url":"https://github.com/mozilla-services/loop-server","homepage":"https://docs.services.mozilla.com/loop/apis.html","size":1985,"stargazers_count":51,"watchers_count":51,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":4,"forks":20,"open_issues":4,"watchers":51,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-services/loop-server/pulls/366"},"html":{"href":"https://github.com/mozilla-services/loop-server/pull/366"},"issue":{"href":"https://api.github.com/repos/mozilla-services/loop-server/issues/366"},"comments":{"href":"https://api.github.com/repos/mozilla-services/loop-server/issues/366/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-services/loop-server/pulls/366/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-services/loop-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla-services/loop-server/pulls/366/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-services/loop-server/statuses/293a4272453908d382c1a29af8b198daee0678d4"}}}}