{"action":"created","comment":{"url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/pulls/comments/45930075","id":45930075,"diff_hunk":"@@ -0,0 +1,54 @@\n+User  = require 'app/models/User.coffee'\n+\n+require '../db.coffee'\n+\n+profile = null\n+\n+checkUserExists = (id) ->\n+\tUser\n+\t\t.findOne id: id\n+\t\t.exec()\n+\t\t.then (found) ->\n+\t\t\tunless found\n+\t\t\t\tthrow new Error 'User not found'\n+\n+describe 'User', ->\n+\tdescribe '#fromOAuthProfile', ->\n+\n+\t\tbeforeEach ->\n+\t\t\tprofile =\n+\t\t\t\tid: 'id'\n+\t\t\t\tprovider: 'provider'\n+\t\t\t\tusername: 'username'\n+\n+\t\tafterEach (done) ->\n+\t\t\tUser.remove {}, -> done()\n+\n+\t\tit \"should create new user if user with the same id doesn't exist\", ->\n+\t\t\tyield User.fromOAuthProfile profile\n+\t\t\tyield checkUserExists 'providerid'\n+\n+\t\tit 'should return existing user', ->","path":"test/models/User.spec.coffee","position":31,"original_position":31,"commit_id":"2c25258feb1560a59c541a773f1afc569e3449bd","original_commit_id":"2c25258feb1560a59c541a773f1afc569e3449bd","user":{"login":"R1ZZU","id":6261302,"avatar_url":"https://avatars.githubusercontent.com/u/6261302?v=3","gravatar_id":"","url":"https://api.github.com/users/R1ZZU","html_url":"https://github.com/R1ZZU","followers_url":"https://api.github.com/users/R1ZZU/followers","following_url":"https://api.github.com/users/R1ZZU/following{/other_user}","gists_url":"https://api.github.com/users/R1ZZU/gists{/gist_id}","starred_url":"https://api.github.com/users/R1ZZU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/R1ZZU/subscriptions","organizations_url":"https://api.github.com/users/R1ZZU/orgs","repos_url":"https://api.github.com/users/R1ZZU/repos","events_url":"https://api.github.com/users/R1ZZU/events{/privacy}","received_events_url":"https://api.github.com/users/R1ZZU/received_events","type":"User","site_admin":false},"body":"https://mochajs.org/example/tests.html\r\nwe can ask TJ why :smile: ","created_at":"2015-11-25T23:14:04Z","updated_at":"2015-11-25T23:14:04Z","html_url":"https://github.com/DaQuirm/css-quickdraw-redux/pull/47#discussion_r45930075","pull_request_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/pulls/47","_links":{"self":{"href":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/pulls/comments/45930075"},"html":{"href":"https://github.com/DaQuirm/css-quickdraw-redux/pull/47#discussion_r45930075"},"pull_request":{"href":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/pulls/47"}}},"pull_request":{"url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/pulls/47","id":51743113,"html_url":"https://github.com/DaQuirm/css-quickdraw-redux/pull/47","diff_url":"https://github.com/DaQuirm/css-quickdraw-redux/pull/47.diff","patch_url":"https://github.com/DaQuirm/css-quickdraw-redux/pull/47.patch","issue_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/issues/47","number":47,"state":"open","locked":false,"title":"Feature/users","user":{"login":"R1ZZU","id":6261302,"avatar_url":"https://avatars.githubusercontent.com/u/6261302?v=3","gravatar_id":"","url":"https://api.github.com/users/R1ZZU","html_url":"https://github.com/R1ZZU","followers_url":"https://api.github.com/users/R1ZZU/followers","following_url":"https://api.github.com/users/R1ZZU/following{/other_user}","gists_url":"https://api.github.com/users/R1ZZU/gists{/gist_id}","starred_url":"https://api.github.com/users/R1ZZU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/R1ZZU/subscriptions","organizations_url":"https://api.github.com/users/R1ZZU/orgs","repos_url":"https://api.github.com/users/R1ZZU/repos","events_url":"https://api.github.com/users/R1ZZU/events{/privacy}","received_events_url":"https://api.github.com/users/R1ZZU/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-25T01:50:35Z","updated_at":"2015-11-25T23:14:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f83b1b4b9ead44e90bd1396b2e4ba98ae3de3709","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/pulls/47/commits","review_comments_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/pulls/47/comments","review_comment_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/issues/47/comments","statuses_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/statuses/2c25258feb1560a59c541a773f1afc569e3449bd","head":{"label":"DaQuirm:feature/users","ref":"feature/users","sha":"2c25258feb1560a59c541a773f1afc569e3449bd","user":{"login":"DaQuirm","id":669784,"avatar_url":"https://avatars.githubusercontent.com/u/669784?v=3","gravatar_id":"","url":"https://api.github.com/users/DaQuirm","html_url":"https://github.com/DaQuirm","followers_url":"https://api.github.com/users/DaQuirm/followers","following_url":"https://api.github.com/users/DaQuirm/following{/other_user}","gists_url":"https://api.github.com/users/DaQuirm/gists{/gist_id}","starred_url":"https://api.github.com/users/DaQuirm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaQuirm/subscriptions","organizations_url":"https://api.github.com/users/DaQuirm/orgs","repos_url":"https://api.github.com/users/DaQuirm/repos","events_url":"https://api.github.com/users/DaQuirm/events{/privacy}","received_events_url":"https://api.github.com/users/DaQuirm/received_events","type":"User","site_admin":false},"repo":{"id":37423777,"name":"css-quickdraw-redux","full_name":"DaQuirm/css-quickdraw-redux","owner":{"login":"DaQuirm","id":669784,"avatar_url":"https://avatars.githubusercontent.com/u/669784?v=3","gravatar_id":"","url":"https://api.github.com/users/DaQuirm","html_url":"https://github.com/DaQuirm","followers_url":"https://api.github.com/users/DaQuirm/followers","following_url":"https://api.github.com/users/DaQuirm/following{/other_user}","gists_url":"https://api.github.com/users/DaQuirm/gists{/gist_id}","starred_url":"https://api.github.com/users/DaQuirm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaQuirm/subscriptions","organizations_url":"https://api.github.com/users/DaQuirm/orgs","repos_url":"https://api.github.com/users/DaQuirm/repos","events_url":"https://api.github.com/users/DaQuirm/events{/privacy}","received_events_url":"https://api.github.com/users/DaQuirm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DaQuirm/css-quickdraw-redux","description":"CSS Selector Multiplayer Puzzle","fork":false,"url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux","forks_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/forks","keys_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/teams","hooks_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/hooks","issue_events_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/issues/events{/number}","events_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/events","assignees_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/assignees{/user}","branches_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/branches{/branch}","tags_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/tags","blobs_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/git/refs{/sha}","trees_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/statuses/{sha}","languages_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/languages","stargazers_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/stargazers","contributors_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/contributors","subscribers_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/subscribers","subscription_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/subscription","commits_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/commits{/sha}","git_commits_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/git/commits{/sha}","comments_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/comments{/number}","issue_comment_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/issues/comments{/number}","contents_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/contents/{+path}","compare_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/merges","archive_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/downloads","issues_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/issues{/number}","pulls_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/pulls{/number}","milestones_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/milestones{/number}","notifications_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/labels{/name}","releases_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/releases{/id}","created_at":"2015-06-14T18:16:21Z","updated_at":"2015-10-07T12:06:42Z","pushed_at":"2015-11-25T01:50:35Z","git_url":"git://github.com/DaQuirm/css-quickdraw-redux.git","ssh_url":"git@github.com:DaQuirm/css-quickdraw-redux.git","clone_url":"https://github.com/DaQuirm/css-quickdraw-redux.git","svn_url":"https://github.com/DaQuirm/css-quickdraw-redux","homepage":null,"size":5167,"stargazers_count":2,"watchers_count":2,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":21,"forks":0,"open_issues":21,"watchers":2,"default_branch":"master"}},"base":{"label":"DaQuirm:master","ref":"master","sha":"a920e131494b0deccac2c763e41d86ce02e11927","user":{"login":"DaQuirm","id":669784,"avatar_url":"https://avatars.githubusercontent.com/u/669784?v=3","gravatar_id":"","url":"https://api.github.com/users/DaQuirm","html_url":"https://github.com/DaQuirm","followers_url":"https://api.github.com/users/DaQuirm/followers","following_url":"https://api.github.com/users/DaQuirm/following{/other_user}","gists_url":"https://api.github.com/users/DaQuirm/gists{/gist_id}","starred_url":"https://api.github.com/users/DaQuirm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaQuirm/subscriptions","organizations_url":"https://api.github.com/users/DaQuirm/orgs","repos_url":"https://api.github.com/users/DaQuirm/repos","events_url":"https://api.github.com/users/DaQuirm/events{/privacy}","received_events_url":"https://api.github.com/users/DaQuirm/received_events","type":"User","site_admin":false},"repo":{"id":37423777,"name":"css-quickdraw-redux","full_name":"DaQuirm/css-quickdraw-redux","owner":{"login":"DaQuirm","id":669784,"avatar_url":"https://avatars.githubusercontent.com/u/669784?v=3","gravatar_id":"","url":"https://api.github.com/users/DaQuirm","html_url":"https://github.com/DaQuirm","followers_url":"https://api.github.com/users/DaQuirm/followers","following_url":"https://api.github.com/users/DaQuirm/following{/other_user}","gists_url":"https://api.github.com/users/DaQuirm/gists{/gist_id}","starred_url":"https://api.github.com/users/DaQuirm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaQuirm/subscriptions","organizations_url":"https://api.github.com/users/DaQuirm/orgs","repos_url":"https://api.github.com/users/DaQuirm/repos","events_url":"https://api.github.com/users/DaQuirm/events{/privacy}","received_events_url":"https://api.github.com/users/DaQuirm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DaQuirm/css-quickdraw-redux","description":"CSS Selector Multiplayer Puzzle","fork":false,"url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux","forks_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/forks","keys_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/teams","hooks_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/hooks","issue_events_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/issues/events{/number}","events_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/events","assignees_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/assignees{/user}","branches_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/branches{/branch}","tags_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/tags","blobs_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/git/refs{/sha}","trees_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/statuses/{sha}","languages_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/languages","stargazers_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/stargazers","contributors_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/contributors","subscribers_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/subscribers","subscription_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/subscription","commits_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/commits{/sha}","git_commits_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/git/commits{/sha}","comments_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/comments{/number}","issue_comment_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/issues/comments{/number}","contents_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/contents/{+path}","compare_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/merges","archive_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/downloads","issues_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/issues{/number}","pulls_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/pulls{/number}","milestones_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/milestones{/number}","notifications_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/labels{/name}","releases_url":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/releases{/id}","created_at":"2015-06-14T18:16:21Z","updated_at":"2015-10-07T12:06:42Z","pushed_at":"2015-11-25T01:50:35Z","git_url":"git://github.com/DaQuirm/css-quickdraw-redux.git","ssh_url":"git@github.com:DaQuirm/css-quickdraw-redux.git","clone_url":"https://github.com/DaQuirm/css-quickdraw-redux.git","svn_url":"https://github.com/DaQuirm/css-quickdraw-redux","homepage":null,"size":5167,"stargazers_count":2,"watchers_count":2,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":21,"forks":0,"open_issues":21,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/pulls/47"},"html":{"href":"https://github.com/DaQuirm/css-quickdraw-redux/pull/47"},"issue":{"href":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/issues/47"},"comments":{"href":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/issues/47/comments"},"review_comments":{"href":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/pulls/47/comments"},"review_comment":{"href":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/pulls/47/commits"},"statuses":{"href":"https://api.github.com/repos/DaQuirm/css-quickdraw-redux/statuses/2c25258feb1560a59c541a773f1afc569e3449bd"}}}}