{"action":"created","comment":{"url":"https://api.github.com/repos/flightstats/node-insights/pulls/comments/28645692","id":28645692,"diff_hunk":"@@ -96,7 +97,17 @@ describe('node-insights', function(){\n     insights.send();\n     setTimeout(function(){\n       expect(scope.isDone()).to.be.true;\n-      expect(body).to.eql('[{\"eventType\":\"purchase\",\"purchase.account\":3,\"purchase.amount\":259.54}]');\n+\n+      var parsedBody = JSON.parse(body);\n+      expect(parsedBody).to.have.length(1);\n+\n+      var processedInsight = parsedBody[0];\n+      expect(Object.keys(processedInsight).sort()).to.eql(['eventType', 'purchase.account', 'purchase.amount', 'timestamp'].sort());\n+      expect(processedInsight.eventType).to.eql('purchase');\n+      expect(processedInsight['purchase.account']).to.eql(3);\n+      expect(processedInsight['purchase.amount']).to.eql(259.54);\n+      expect(processedInsight.timestamp).to.be.at.least(addTime);\n+","path":"tests/index.js","position":23,"original_position":23,"commit_id":"c75c46a95b2d8fad58ea01b69bf1579b07375c08","original_commit_id":"c75c46a95b2d8fad58ea01b69bf1579b07375c08","user":{"login":"wraithan","id":90898,"avatar_url":"https://avatars.githubusercontent.com/u/90898?v=3","gravatar_id":"","url":"https://api.github.com/users/wraithan","html_url":"https://github.com/wraithan","followers_url":"https://api.github.com/users/wraithan/followers","following_url":"https://api.github.com/users/wraithan/following{/other_user}","gists_url":"https://api.github.com/users/wraithan/gists{/gist_id}","starred_url":"https://api.github.com/users/wraithan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wraithan/subscriptions","organizations_url":"https://api.github.com/users/wraithan/orgs","repos_url":"https://api.github.com/users/wraithan/repos","events_url":"https://api.github.com/users/wraithan/events{/privacy}","received_events_url":"https://api.github.com/users/wraithan/received_events","type":"User","site_admin":false},"body":"This style is more verbose but should be just as precise and allows for variable data to be added (e.g. the `timestamp` field)","created_at":"2015-04-18T17:10:15Z","updated_at":"2015-04-18T17:10:15Z","html_url":"https://github.com/flightstats/node-insights/pull/7#discussion_r28645692","pull_request_url":"https://api.github.com/repos/flightstats/node-insights/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/flightstats/node-insights/pulls/comments/28645692"},"html":{"href":"https://github.com/flightstats/node-insights/pull/7#discussion_r28645692"},"pull_request":{"href":"https://api.github.com/repos/flightstats/node-insights/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/flightstats/node-insights/pulls/7","id":33605260,"html_url":"https://github.com/flightstats/node-insights/pull/7","diff_url":"https://github.com/flightstats/node-insights/pull/7.diff","patch_url":"https://github.com/flightstats/node-insights/pull/7.patch","issue_url":"https://api.github.com/repos/flightstats/node-insights/issues/7","number":7,"state":"open","locked":false,"title":"track the add time of events","user":{"login":"wraithan","id":90898,"avatar_url":"https://avatars.githubusercontent.com/u/90898?v=3","gravatar_id":"","url":"https://api.github.com/users/wraithan","html_url":"https://github.com/wraithan","followers_url":"https://api.github.com/users/wraithan/followers","following_url":"https://api.github.com/users/wraithan/following{/other_user}","gists_url":"https://api.github.com/users/wraithan/gists{/gist_id}","starred_url":"https://api.github.com/users/wraithan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wraithan/subscriptions","organizations_url":"https://api.github.com/users/wraithan/orgs","repos_url":"https://api.github.com/users/wraithan/repos","events_url":"https://api.github.com/users/wraithan/events{/privacy}","received_events_url":"https://api.github.com/users/wraithan/received_events","type":"User","site_admin":false},"body":"This fixes #4. It adds the timestamp to the object when it is added if the timestamp field was not already set. It uses `Date.now()` which provides the time in ms since epoch.\n\nI had to update a couple tests to account for this variable data. Also I added a test to make sure it doesn't stomp the timestamp.","created_at":"2015-04-18T17:05:06Z","updated_at":"2015-04-18T17:10:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"223932e26eea9bf9105f7523503258b54e40b314","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/flightstats/node-insights/pulls/7/commits","review_comments_url":"https://api.github.com/repos/flightstats/node-insights/pulls/7/comments","review_comment_url":"https://api.github.com/repos/flightstats/node-insights/pulls/comments{/number}","comments_url":"https://api.github.com/repos/flightstats/node-insights/issues/7/comments","statuses_url":"https://api.github.com/repos/flightstats/node-insights/statuses/c75c46a95b2d8fad58ea01b69bf1579b07375c08","head":{"label":"wraithan:wraithan/add_timestamp","ref":"wraithan/add_timestamp","sha":"c75c46a95b2d8fad58ea01b69bf1579b07375c08","user":{"login":"wraithan","id":90898,"avatar_url":"https://avatars.githubusercontent.com/u/90898?v=3","gravatar_id":"","url":"https://api.github.com/users/wraithan","html_url":"https://github.com/wraithan","followers_url":"https://api.github.com/users/wraithan/followers","following_url":"https://api.github.com/users/wraithan/following{/other_user}","gists_url":"https://api.github.com/users/wraithan/gists{/gist_id}","starred_url":"https://api.github.com/users/wraithan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wraithan/subscriptions","organizations_url":"https://api.github.com/users/wraithan/orgs","repos_url":"https://api.github.com/users/wraithan/repos","events_url":"https://api.github.com/users/wraithan/events{/privacy}","received_events_url":"https://api.github.com/users/wraithan/received_events","type":"User","site_admin":false},"repo":{"id":34171708,"name":"node-insights","full_name":"wraithan/node-insights","owner":{"login":"wraithan","id":90898,"avatar_url":"https://avatars.githubusercontent.com/u/90898?v=3","gravatar_id":"","url":"https://api.github.com/users/wraithan","html_url":"https://github.com/wraithan","followers_url":"https://api.github.com/users/wraithan/followers","following_url":"https://api.github.com/users/wraithan/following{/other_user}","gists_url":"https://api.github.com/users/wraithan/gists{/gist_id}","starred_url":"https://api.github.com/users/wraithan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wraithan/subscriptions","organizations_url":"https://api.github.com/users/wraithan/orgs","repos_url":"https://api.github.com/users/wraithan/repos","events_url":"https://api.github.com/users/wraithan/events{/privacy}","received_events_url":"https://api.github.com/users/wraithan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wraithan/node-insights","description":"Submit data to New Relic Insights","fork":true,"url":"https://api.github.com/repos/wraithan/node-insights","forks_url":"https://api.github.com/repos/wraithan/node-insights/forks","keys_url":"https://api.github.com/repos/wraithan/node-insights/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wraithan/node-insights/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wraithan/node-insights/teams","hooks_url":"https://api.github.com/repos/wraithan/node-insights/hooks","issue_events_url":"https://api.github.com/repos/wraithan/node-insights/issues/events{/number}","events_url":"https://api.github.com/repos/wraithan/node-insights/events","assignees_url":"https://api.github.com/repos/wraithan/node-insights/assignees{/user}","branches_url":"https://api.github.com/repos/wraithan/node-insights/branches{/branch}","tags_url":"https://api.github.com/repos/wraithan/node-insights/tags","blobs_url":"https://api.github.com/repos/wraithan/node-insights/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wraithan/node-insights/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wraithan/node-insights/git/refs{/sha}","trees_url":"https://api.github.com/repos/wraithan/node-insights/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wraithan/node-insights/statuses/{sha}","languages_url":"https://api.github.com/repos/wraithan/node-insights/languages","stargazers_url":"https://api.github.com/repos/wraithan/node-insights/stargazers","contributors_url":"https://api.github.com/repos/wraithan/node-insights/contributors","subscribers_url":"https://api.github.com/repos/wraithan/node-insights/subscribers","subscription_url":"https://api.github.com/repos/wraithan/node-insights/subscription","commits_url":"https://api.github.com/repos/wraithan/node-insights/commits{/sha}","git_commits_url":"https://api.github.com/repos/wraithan/node-insights/git/commits{/sha}","comments_url":"https://api.github.com/repos/wraithan/node-insights/comments{/number}","issue_comment_url":"https://api.github.com/repos/wraithan/node-insights/issues/comments{/number}","contents_url":"https://api.github.com/repos/wraithan/node-insights/contents/{+path}","compare_url":"https://api.github.com/repos/wraithan/node-insights/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wraithan/node-insights/merges","archive_url":"https://api.github.com/repos/wraithan/node-insights/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wraithan/node-insights/downloads","issues_url":"https://api.github.com/repos/wraithan/node-insights/issues{/number}","pulls_url":"https://api.github.com/repos/wraithan/node-insights/pulls{/number}","milestones_url":"https://api.github.com/repos/wraithan/node-insights/milestones{/number}","notifications_url":"https://api.github.com/repos/wraithan/node-insights/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wraithan/node-insights/labels{/name}","releases_url":"https://api.github.com/repos/wraithan/node-insights/releases{/id}","created_at":"2015-04-18T15:46:42Z","updated_at":"2015-04-18T15:46:42Z","pushed_at":"2015-04-18T17:02:45Z","git_url":"git://github.com/wraithan/node-insights.git","ssh_url":"git@github.com:wraithan/node-insights.git","clone_url":"https://github.com/wraithan/node-insights.git","svn_url":"https://github.com/wraithan/node-insights","homepage":null,"size":99,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"flightstats:master","ref":"master","sha":"54b5a7e3f7deb3ec3b36135b921dbc1b4a937401","user":{"login":"flightstats","id":2643228,"avatar_url":"https://avatars.githubusercontent.com/u/2643228?v=3","gravatar_id":"","url":"https://api.github.com/users/flightstats","html_url":"https://github.com/flightstats","followers_url":"https://api.github.com/users/flightstats/followers","following_url":"https://api.github.com/users/flightstats/following{/other_user}","gists_url":"https://api.github.com/users/flightstats/gists{/gist_id}","starred_url":"https://api.github.com/users/flightstats/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flightstats/subscriptions","organizations_url":"https://api.github.com/users/flightstats/orgs","repos_url":"https://api.github.com/users/flightstats/repos","events_url":"https://api.github.com/users/flightstats/events{/privacy}","received_events_url":"https://api.github.com/users/flightstats/received_events","type":"Organization","site_admin":false},"repo":{"id":33380301,"name":"node-insights","full_name":"flightstats/node-insights","owner":{"login":"flightstats","id":2643228,"avatar_url":"https://avatars.githubusercontent.com/u/2643228?v=3","gravatar_id":"","url":"https://api.github.com/users/flightstats","html_url":"https://github.com/flightstats","followers_url":"https://api.github.com/users/flightstats/followers","following_url":"https://api.github.com/users/flightstats/following{/other_user}","gists_url":"https://api.github.com/users/flightstats/gists{/gist_id}","starred_url":"https://api.github.com/users/flightstats/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flightstats/subscriptions","organizations_url":"https://api.github.com/users/flightstats/orgs","repos_url":"https://api.github.com/users/flightstats/repos","events_url":"https://api.github.com/users/flightstats/events{/privacy}","received_events_url":"https://api.github.com/users/flightstats/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/flightstats/node-insights","description":"Submit data to New Relic Insights","fork":false,"url":"https://api.github.com/repos/flightstats/node-insights","forks_url":"https://api.github.com/repos/flightstats/node-insights/forks","keys_url":"https://api.github.com/repos/flightstats/node-insights/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flightstats/node-insights/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flightstats/node-insights/teams","hooks_url":"https://api.github.com/repos/flightstats/node-insights/hooks","issue_events_url":"https://api.github.com/repos/flightstats/node-insights/issues/events{/number}","events_url":"https://api.github.com/repos/flightstats/node-insights/events","assignees_url":"https://api.github.com/repos/flightstats/node-insights/assignees{/user}","branches_url":"https://api.github.com/repos/flightstats/node-insights/branches{/branch}","tags_url":"https://api.github.com/repos/flightstats/node-insights/tags","blobs_url":"https://api.github.com/repos/flightstats/node-insights/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flightstats/node-insights/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flightstats/node-insights/git/refs{/sha}","trees_url":"https://api.github.com/repos/flightstats/node-insights/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flightstats/node-insights/statuses/{sha}","languages_url":"https://api.github.com/repos/flightstats/node-insights/languages","stargazers_url":"https://api.github.com/repos/flightstats/node-insights/stargazers","contributors_url":"https://api.github.com/repos/flightstats/node-insights/contributors","subscribers_url":"https://api.github.com/repos/flightstats/node-insights/subscribers","subscription_url":"https://api.github.com/repos/flightstats/node-insights/subscription","commits_url":"https://api.github.com/repos/flightstats/node-insights/commits{/sha}","git_commits_url":"https://api.github.com/repos/flightstats/node-insights/git/commits{/sha}","comments_url":"https://api.github.com/repos/flightstats/node-insights/comments{/number}","issue_comment_url":"https://api.github.com/repos/flightstats/node-insights/issues/comments{/number}","contents_url":"https://api.github.com/repos/flightstats/node-insights/contents/{+path}","compare_url":"https://api.github.com/repos/flightstats/node-insights/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flightstats/node-insights/merges","archive_url":"https://api.github.com/repos/flightstats/node-insights/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flightstats/node-insights/downloads","issues_url":"https://api.github.com/repos/flightstats/node-insights/issues{/number}","pulls_url":"https://api.github.com/repos/flightstats/node-insights/pulls{/number}","milestones_url":"https://api.github.com/repos/flightstats/node-insights/milestones{/number}","notifications_url":"https://api.github.com/repos/flightstats/node-insights/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flightstats/node-insights/labels{/name}","releases_url":"https://api.github.com/repos/flightstats/node-insights/releases{/id}","created_at":"2015-04-03T19:57:50Z","updated_at":"2015-04-08T18:54:46Z","pushed_at":"2015-04-18T17:05:07Z","git_url":"git://github.com/flightstats/node-insights.git","ssh_url":"git@github.com:flightstats/node-insights.git","clone_url":"https://github.com/flightstats/node-insights.git","svn_url":"https://github.com/flightstats/node-insights","homepage":null,"size":285,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/flightstats/node-insights/pulls/7"},"html":{"href":"https://github.com/flightstats/node-insights/pull/7"},"issue":{"href":"https://api.github.com/repos/flightstats/node-insights/issues/7"},"comments":{"href":"https://api.github.com/repos/flightstats/node-insights/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/flightstats/node-insights/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/flightstats/node-insights/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/flightstats/node-insights/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/flightstats/node-insights/statuses/c75c46a95b2d8fad58ea01b69bf1579b07375c08"}}}}