{"action":"created","comment":{"url":"https://api.github.com/repos/coderbunker/candra/pulls/comments/77955239","id":77955239,"diff_hunk":"@@ -0,0 +1,82 @@\n+import { Meteor } from 'meteor/meteor';\n+import { chai } from 'meteor/practicalmeteor:chai';\n+import logs from '../../../lib/collections/OrgLogs.js';\n+import { resetDatabase } from 'meteor/xolvio:cleaner';\n+\n+const TEST_URL = 'http://example.com/api';\n+\n+beforeEach(function() {\n+  resetDatabase();\n+});\n+\n+describe('OrgLogs', function () {\n+  function skip_client(name, callback) {\n+    if(!Meteor.isClient) {\n+      it(name, callback);\n+    }\n+  }\n+\n+  skip_client('adding a new successful log', function () {\n+    var newLog = logs.createNewSuccessLog(TEST_URL, {payload: 'some string'});\n+    logs.createOrUpdateLog(newLog);\n+\n+    var entry = logs.OrgLogs.findOne({url: TEST_URL});\n+    chai.assert.instanceOf(entry.timestamp, Date);\n+    chai.assert.equal(entry.statusCode, 200);\n+    chai.assert.instanceOf(entry.lastSuccess, Date);\n+  });\n+\n+  skip_client('adding a new log with error', function () {\n+    var newLog = logs.createNewErrorLog(TEST_URL, {response: {statusCode: 404}});\n+    logs.createOrUpdateLog(newLog);\n+\n+    var entry = logs.OrgLogs.findOne({url: TEST_URL});\n+    chai.assert.instanceOf(entry.timestamp, Date);\n+    chai.assert.equal(entry.statusCode, 404);\n+    chai.assert.equal(entry.lastSuccess, null);\n+  });\n+\n+  skip_client('error log followed by successful log', function() {\n+    var errorLog = logs.createNewErrorLog(TEST_URL, {response: {statusCode: 404}});\n+    var successLog = logs.createNewSuccessLog(TEST_URL, {payload: 'some string'});\n+\n+    logs.createOrUpdateLog(errorLog);\n+    logs.createOrUpdateLog(successLog);\n+\n+    var entry = logs.OrgLogs.findOne({url: TEST_URL});\n+    chai.assert.equal(entry.statusCode, 200);\n+    chai.assert.instanceOf(entry.lastSuccess, Date);\n+    chai.assert.equal(entry.error, null);\n+    chai.assert.equal(entry.data.payload, 'some string');","path":"app/imports/lib/collections/OrgLogs.test.js","position":50,"original_position":50,"commit_id":"74fe8bedec04d57b03036c1ef01262c4035c7f7f","original_commit_id":"74fe8bedec04d57b03036c1ef01262c4035c7f7f","user":{"login":"rngadam","id":538542,"avatar_url":"https://avatars.githubusercontent.com/u/538542?v=3","gravatar_id":"","url":"https://api.github.com/users/rngadam","html_url":"https://github.com/rngadam","followers_url":"https://api.github.com/users/rngadam/followers","following_url":"https://api.github.com/users/rngadam/following{/other_user}","gists_url":"https://api.github.com/users/rngadam/gists{/gist_id}","starred_url":"https://api.github.com/users/rngadam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rngadam/subscriptions","organizations_url":"https://api.github.com/users/rngadam/orgs","repos_url":"https://api.github.com/users/rngadam/repos","events_url":"https://api.github.com/users/rngadam/events{/privacy}","received_events_url":"https://api.github.com/users/rngadam/received_events","type":"User","site_admin":false},"body":"done","created_at":"2016-09-08T07:07:44Z","updated_at":"2016-09-08T07:07:44Z","html_url":"https://github.com/coderbunker/candra/pull/46#discussion_r77955239","pull_request_url":"https://api.github.com/repos/coderbunker/candra/pulls/46","_links":{"self":{"href":"https://api.github.com/repos/coderbunker/candra/pulls/comments/77955239"},"html":{"href":"https://github.com/coderbunker/candra/pull/46#discussion_r77955239"},"pull_request":{"href":"https://api.github.com/repos/coderbunker/candra/pulls/46"}}},"pull_request":{"url":"https://api.github.com/repos/coderbunker/candra/pulls/46","id":83979865,"html_url":"https://github.com/coderbunker/candra/pull/46","diff_url":"https://github.com/coderbunker/candra/pull/46.diff","patch_url":"https://github.com/coderbunker/candra/pull/46.patch","issue_url":"https://api.github.com/repos/coderbunker/candra/issues/46","number":46,"state":"open","locked":false,"title":"Issue #30: add admin panel for requests to space api","user":{"login":"thimovss","id":8835734,"avatar_url":"https://avatars.githubusercontent.com/u/8835734?v=3","gravatar_id":"","url":"https://api.github.com/users/thimovss","html_url":"https://github.com/thimovss","followers_url":"https://api.github.com/users/thimovss/followers","following_url":"https://api.github.com/users/thimovss/following{/other_user}","gists_url":"https://api.github.com/users/thimovss/gists{/gist_id}","starred_url":"https://api.github.com/users/thimovss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thimovss/subscriptions","organizations_url":"https://api.github.com/users/thimovss/orgs","repos_url":"https://api.github.com/users/thimovss/repos","events_url":"https://api.github.com/users/thimovss/events{/privacy}","received_events_url":"https://api.github.com/users/thimovss/received_events","type":"User","site_admin":false},"body":"![Uploading FireShot Screen Capture #033 - 'Membership Management System' - localhost_3000_admi.png…]()\r\n","created_at":"2016-09-05T10:14:59Z","updated_at":"2016-09-08T07:07:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"89f4c3d96e978dfc90ca398db663f7373021e7d0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/coderbunker/candra/pulls/46/commits","review_comments_url":"https://api.github.com/repos/coderbunker/candra/pulls/46/comments","review_comment_url":"https://api.github.com/repos/coderbunker/candra/pulls/comments{/number}","comments_url":"https://api.github.com/repos/coderbunker/candra/issues/46/comments","statuses_url":"https://api.github.com/repos/coderbunker/candra/statuses/74fe8bedec04d57b03036c1ef01262c4035c7f7f","head":{"label":"coderbunker:issue30","ref":"issue30","sha":"74fe8bedec04d57b03036c1ef01262c4035c7f7f","user":{"login":"coderbunker","id":14820871,"avatar_url":"https://avatars.githubusercontent.com/u/14820871?v=3","gravatar_id":"","url":"https://api.github.com/users/coderbunker","html_url":"https://github.com/coderbunker","followers_url":"https://api.github.com/users/coderbunker/followers","following_url":"https://api.github.com/users/coderbunker/following{/other_user}","gists_url":"https://api.github.com/users/coderbunker/gists{/gist_id}","starred_url":"https://api.github.com/users/coderbunker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coderbunker/subscriptions","organizations_url":"https://api.github.com/users/coderbunker/orgs","repos_url":"https://api.github.com/users/coderbunker/repos","events_url":"https://api.github.com/users/coderbunker/events{/privacy}","received_events_url":"https://api.github.com/users/coderbunker/received_events","type":"Organization","site_admin":false},"repo":{"id":44000549,"name":"candra","full_name":"coderbunker/candra","owner":{"login":"coderbunker","id":14820871,"avatar_url":"https://avatars.githubusercontent.com/u/14820871?v=3","gravatar_id":"","url":"https://api.github.com/users/coderbunker","html_url":"https://github.com/coderbunker","followers_url":"https://api.github.com/users/coderbunker/followers","following_url":"https://api.github.com/users/coderbunker/following{/other_user}","gists_url":"https://api.github.com/users/coderbunker/gists{/gist_id}","starred_url":"https://api.github.com/users/coderbunker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coderbunker/subscriptions","organizations_url":"https://api.github.com/users/coderbunker/orgs","repos_url":"https://api.github.com/users/coderbunker/repos","events_url":"https://api.github.com/users/coderbunker/events{/privacy}","received_events_url":"https://api.github.com/users/coderbunker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/coderbunker/candra","description":"Modern Community Management System","fork":false,"url":"https://api.github.com/repos/coderbunker/candra","forks_url":"https://api.github.com/repos/coderbunker/candra/forks","keys_url":"https://api.github.com/repos/coderbunker/candra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coderbunker/candra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coderbunker/candra/teams","hooks_url":"https://api.github.com/repos/coderbunker/candra/hooks","issue_events_url":"https://api.github.com/repos/coderbunker/candra/issues/events{/number}","events_url":"https://api.github.com/repos/coderbunker/candra/events","assignees_url":"https://api.github.com/repos/coderbunker/candra/assignees{/user}","branches_url":"https://api.github.com/repos/coderbunker/candra/branches{/branch}","tags_url":"https://api.github.com/repos/coderbunker/candra/tags","blobs_url":"https://api.github.com/repos/coderbunker/candra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coderbunker/candra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coderbunker/candra/git/refs{/sha}","trees_url":"https://api.github.com/repos/coderbunker/candra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coderbunker/candra/statuses/{sha}","languages_url":"https://api.github.com/repos/coderbunker/candra/languages","stargazers_url":"https://api.github.com/repos/coderbunker/candra/stargazers","contributors_url":"https://api.github.com/repos/coderbunker/candra/contributors","subscribers_url":"https://api.github.com/repos/coderbunker/candra/subscribers","subscription_url":"https://api.github.com/repos/coderbunker/candra/subscription","commits_url":"https://api.github.com/repos/coderbunker/candra/commits{/sha}","git_commits_url":"https://api.github.com/repos/coderbunker/candra/git/commits{/sha}","comments_url":"https://api.github.com/repos/coderbunker/candra/comments{/number}","issue_comment_url":"https://api.github.com/repos/coderbunker/candra/issues/comments{/number}","contents_url":"https://api.github.com/repos/coderbunker/candra/contents/{+path}","compare_url":"https://api.github.com/repos/coderbunker/candra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coderbunker/candra/merges","archive_url":"https://api.github.com/repos/coderbunker/candra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coderbunker/candra/downloads","issues_url":"https://api.github.com/repos/coderbunker/candra/issues{/number}","pulls_url":"https://api.github.com/repos/coderbunker/candra/pulls{/number}","milestones_url":"https://api.github.com/repos/coderbunker/candra/milestones{/number}","notifications_url":"https://api.github.com/repos/coderbunker/candra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coderbunker/candra/labels{/name}","releases_url":"https://api.github.com/repos/coderbunker/candra/releases{/id}","deployments_url":"https://api.github.com/repos/coderbunker/candra/deployments","created_at":"2015-10-10T07:51:15Z","updated_at":"2016-05-31T14:35:44Z","pushed_at":"2016-09-07T11:48:11Z","git_url":"git://github.com/coderbunker/candra.git","ssh_url":"git@github.com:coderbunker/candra.git","clone_url":"https://github.com/coderbunker/candra.git","svn_url":"https://github.com/coderbunker/candra","homepage":"","size":336,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":25,"forks":4,"open_issues":25,"watchers":6,"default_branch":"develop"}},"base":{"label":"coderbunker:develop","ref":"develop","sha":"d382c914b343ececb90579ff01b26f13316dffc4","user":{"login":"coderbunker","id":14820871,"avatar_url":"https://avatars.githubusercontent.com/u/14820871?v=3","gravatar_id":"","url":"https://api.github.com/users/coderbunker","html_url":"https://github.com/coderbunker","followers_url":"https://api.github.com/users/coderbunker/followers","following_url":"https://api.github.com/users/coderbunker/following{/other_user}","gists_url":"https://api.github.com/users/coderbunker/gists{/gist_id}","starred_url":"https://api.github.com/users/coderbunker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coderbunker/subscriptions","organizations_url":"https://api.github.com/users/coderbunker/orgs","repos_url":"https://api.github.com/users/coderbunker/repos","events_url":"https://api.github.com/users/coderbunker/events{/privacy}","received_events_url":"https://api.github.com/users/coderbunker/received_events","type":"Organization","site_admin":false},"repo":{"id":44000549,"name":"candra","full_name":"coderbunker/candra","owner":{"login":"coderbunker","id":14820871,"avatar_url":"https://avatars.githubusercontent.com/u/14820871?v=3","gravatar_id":"","url":"https://api.github.com/users/coderbunker","html_url":"https://github.com/coderbunker","followers_url":"https://api.github.com/users/coderbunker/followers","following_url":"https://api.github.com/users/coderbunker/following{/other_user}","gists_url":"https://api.github.com/users/coderbunker/gists{/gist_id}","starred_url":"https://api.github.com/users/coderbunker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coderbunker/subscriptions","organizations_url":"https://api.github.com/users/coderbunker/orgs","repos_url":"https://api.github.com/users/coderbunker/repos","events_url":"https://api.github.com/users/coderbunker/events{/privacy}","received_events_url":"https://api.github.com/users/coderbunker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/coderbunker/candra","description":"Modern Community Management System","fork":false,"url":"https://api.github.com/repos/coderbunker/candra","forks_url":"https://api.github.com/repos/coderbunker/candra/forks","keys_url":"https://api.github.com/repos/coderbunker/candra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coderbunker/candra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coderbunker/candra/teams","hooks_url":"https://api.github.com/repos/coderbunker/candra/hooks","issue_events_url":"https://api.github.com/repos/coderbunker/candra/issues/events{/number}","events_url":"https://api.github.com/repos/coderbunker/candra/events","assignees_url":"https://api.github.com/repos/coderbunker/candra/assignees{/user}","branches_url":"https://api.github.com/repos/coderbunker/candra/branches{/branch}","tags_url":"https://api.github.com/repos/coderbunker/candra/tags","blobs_url":"https://api.github.com/repos/coderbunker/candra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coderbunker/candra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coderbunker/candra/git/refs{/sha}","trees_url":"https://api.github.com/repos/coderbunker/candra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coderbunker/candra/statuses/{sha}","languages_url":"https://api.github.com/repos/coderbunker/candra/languages","stargazers_url":"https://api.github.com/repos/coderbunker/candra/stargazers","contributors_url":"https://api.github.com/repos/coderbunker/candra/contributors","subscribers_url":"https://api.github.com/repos/coderbunker/candra/subscribers","subscription_url":"https://api.github.com/repos/coderbunker/candra/subscription","commits_url":"https://api.github.com/repos/coderbunker/candra/commits{/sha}","git_commits_url":"https://api.github.com/repos/coderbunker/candra/git/commits{/sha}","comments_url":"https://api.github.com/repos/coderbunker/candra/comments{/number}","issue_comment_url":"https://api.github.com/repos/coderbunker/candra/issues/comments{/number}","contents_url":"https://api.github.com/repos/coderbunker/candra/contents/{+path}","compare_url":"https://api.github.com/repos/coderbunker/candra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coderbunker/candra/merges","archive_url":"https://api.github.com/repos/coderbunker/candra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coderbunker/candra/downloads","issues_url":"https://api.github.com/repos/coderbunker/candra/issues{/number}","pulls_url":"https://api.github.com/repos/coderbunker/candra/pulls{/number}","milestones_url":"https://api.github.com/repos/coderbunker/candra/milestones{/number}","notifications_url":"https://api.github.com/repos/coderbunker/candra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coderbunker/candra/labels{/name}","releases_url":"https://api.github.com/repos/coderbunker/candra/releases{/id}","deployments_url":"https://api.github.com/repos/coderbunker/candra/deployments","created_at":"2015-10-10T07:51:15Z","updated_at":"2016-05-31T14:35:44Z","pushed_at":"2016-09-07T11:48:11Z","git_url":"git://github.com/coderbunker/candra.git","ssh_url":"git@github.com:coderbunker/candra.git","clone_url":"https://github.com/coderbunker/candra.git","svn_url":"https://github.com/coderbunker/candra","homepage":"","size":336,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":25,"forks":4,"open_issues":25,"watchers":6,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/coderbunker/candra/pulls/46"},"html":{"href":"https://github.com/coderbunker/candra/pull/46"},"issue":{"href":"https://api.github.com/repos/coderbunker/candra/issues/46"},"comments":{"href":"https://api.github.com/repos/coderbunker/candra/issues/46/comments"},"review_comments":{"href":"https://api.github.com/repos/coderbunker/candra/pulls/46/comments"},"review_comment":{"href":"https://api.github.com/repos/coderbunker/candra/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/coderbunker/candra/pulls/46/commits"},"statuses":{"href":"https://api.github.com/repos/coderbunker/candra/statuses/74fe8bedec04d57b03036c1ef01262c4035c7f7f"}}}}
{"actor":{"display_login":"rngadam"}}