{"action":"created","comment":{"url":"https://api.github.com/repos/andela/getmyshop/pulls/comments/55372475","id":55372475,"diff_hunk":"@@ -0,0 +1,36 @@\n+require \"support/oauth_spec_helper\"\n+RSpec.shared_examples \"oauth example\" do |provider, new_user|\n+  include OauthSpecHelper\n+  def setup(provider)\n+    case provider\n+    when :twitter then twitter_setup\n+    when :facebook then facebook_setup\n+    when :google then google_setup\n+    end\n+  end\n+\n+  it \"creates and logs in an Oauth user\" do\n+    setup(provider)\n+    request.env[\"omniauth.auth\"] = OmniAuth.config.mock_auth[provider]\n+    get :create, provider: provider.to_s\n+    expect(session[:user_id]).to eq(User.last.id)\n+  end\n+\n+  it \"Logs in an existing Oauth user\" do\n+    user = create(:regular_user)\n+    setup_params = setup(provider)\n+    auth_params = { provider: setup_params.provider,\n+      uid: setup_params.uid,\n+      oauth_secret: setup_params.secret,\n+      oauth_token: setup_params.token,\n+      oauth_expires: setup_params.expires_at,\n+      user_id: user.id","path":"spec/support/oauth_example.rb","position":27,"original_position":27,"commit_id":"7f8f567886c8a38d1b99c1808e6e84790e49536c","original_commit_id":"7f8f567886c8a38d1b99c1808e6e84790e49536c","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Align the elements of a hash literal if they span more than one line.","created_at":"2016-03-08T15:16:05Z","updated_at":"2016-03-08T15:16:05Z","html_url":"https://github.com/andela/getmyshop/pull/63#discussion_r55372475","pull_request_url":"https://api.github.com/repos/andela/getmyshop/pulls/63","_links":{"self":{"href":"https://api.github.com/repos/andela/getmyshop/pulls/comments/55372475"},"html":{"href":"https://github.com/andela/getmyshop/pull/63#discussion_r55372475"},"pull_request":{"href":"https://api.github.com/repos/andela/getmyshop/pulls/63"}}},"pull_request":{"url":"https://api.github.com/repos/andela/getmyshop/pulls/63","id":61887688,"html_url":"https://github.com/andela/getmyshop/pull/63","diff_url":"https://github.com/andela/getmyshop/pull/63.diff","patch_url":"https://github.com/andela/getmyshop/pull/63.patch","issue_url":"https://api.github.com/repos/andela/getmyshop/issues/63","number":63,"state":"open","locked":false,"title":"Test OAuth functionality","user":{"login":"andela-oosiname","id":14161156,"avatar_url":"https://avatars.githubusercontent.com/u/14161156?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-oosiname","html_url":"https://github.com/andela-oosiname","followers_url":"https://api.github.com/users/andela-oosiname/followers","following_url":"https://api.github.com/users/andela-oosiname/following{/other_user}","gists_url":"https://api.github.com/users/andela-oosiname/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-oosiname/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-oosiname/subscriptions","organizations_url":"https://api.github.com/users/andela-oosiname/orgs","repos_url":"https://api.github.com/users/andela-oosiname/repos","events_url":"https://api.github.com/users/andela-oosiname/events{/privacy}","received_events_url":"https://api.github.com/users/andela-oosiname/received_events","type":"User","site_admin":false},"body":"test that when a user decides to sign up or sign in with OAuth (Google, Facebook, Twitter), action is successful.\r\n\r\nhttps://www.pivotaltracker.com/story/show/114385351\r\n\r\n[finishes #114385351]","created_at":"2016-03-07T08:49:40Z","updated_at":"2016-03-08T15:16:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3648d0e02c5b9b5fdecacd862923fb5589c150b2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/andela/getmyshop/pulls/63/commits","review_comments_url":"https://api.github.com/repos/andela/getmyshop/pulls/63/comments","review_comment_url":"https://api.github.com/repos/andela/getmyshop/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela/getmyshop/issues/63/comments","statuses_url":"https://api.github.com/repos/andela/getmyshop/statuses/7f8f567886c8a38d1b99c1808e6e84790e49536c","head":{"label":"andela:ft-test-oauth-functionality-114385351","ref":"ft-test-oauth-functionality-114385351","sha":"7f8f567886c8a38d1b99c1808e6e84790e49536c","user":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":45830862,"name":"getmyshop","full_name":"andela/getmyshop","owner":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/getmyshop","description":"Online shop for rent","fork":false,"url":"https://api.github.com/repos/andela/getmyshop","forks_url":"https://api.github.com/repos/andela/getmyshop/forks","keys_url":"https://api.github.com/repos/andela/getmyshop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/getmyshop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/getmyshop/teams","hooks_url":"https://api.github.com/repos/andela/getmyshop/hooks","issue_events_url":"https://api.github.com/repos/andela/getmyshop/issues/events{/number}","events_url":"https://api.github.com/repos/andela/getmyshop/events","assignees_url":"https://api.github.com/repos/andela/getmyshop/assignees{/user}","branches_url":"https://api.github.com/repos/andela/getmyshop/branches{/branch}","tags_url":"https://api.github.com/repos/andela/getmyshop/tags","blobs_url":"https://api.github.com/repos/andela/getmyshop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/getmyshop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/getmyshop/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/getmyshop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/getmyshop/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/getmyshop/languages","stargazers_url":"https://api.github.com/repos/andela/getmyshop/stargazers","contributors_url":"https://api.github.com/repos/andela/getmyshop/contributors","subscribers_url":"https://api.github.com/repos/andela/getmyshop/subscribers","subscription_url":"https://api.github.com/repos/andela/getmyshop/subscription","commits_url":"https://api.github.com/repos/andela/getmyshop/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/getmyshop/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/getmyshop/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/getmyshop/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/getmyshop/contents/{+path}","compare_url":"https://api.github.com/repos/andela/getmyshop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/getmyshop/merges","archive_url":"https://api.github.com/repos/andela/getmyshop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/getmyshop/downloads","issues_url":"https://api.github.com/repos/andela/getmyshop/issues{/number}","pulls_url":"https://api.github.com/repos/andela/getmyshop/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/getmyshop/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/getmyshop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/getmyshop/labels{/name}","releases_url":"https://api.github.com/repos/andela/getmyshop/releases{/id}","deployments_url":"https://api.github.com/repos/andela/getmyshop/deployments","created_at":"2015-11-09T10:22:52Z","updated_at":"2016-03-01T11:23:55Z","pushed_at":"2016-03-08T15:16:00Z","git_url":"git://github.com/andela/getmyshop.git","ssh_url":"git@github.com:andela/getmyshop.git","clone_url":"https://github.com/andela/getmyshop.git","svn_url":"https://github.com/andela/getmyshop","homepage":null,"size":1188,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":3,"default_branch":"master"}},"base":{"label":"andela:master","ref":"master","sha":"14efdf79eadebc38dec4045c1cff28f7d7f6cb9d","user":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":45830862,"name":"getmyshop","full_name":"andela/getmyshop","owner":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/getmyshop","description":"Online shop for rent","fork":false,"url":"https://api.github.com/repos/andela/getmyshop","forks_url":"https://api.github.com/repos/andela/getmyshop/forks","keys_url":"https://api.github.com/repos/andela/getmyshop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/getmyshop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/getmyshop/teams","hooks_url":"https://api.github.com/repos/andela/getmyshop/hooks","issue_events_url":"https://api.github.com/repos/andela/getmyshop/issues/events{/number}","events_url":"https://api.github.com/repos/andela/getmyshop/events","assignees_url":"https://api.github.com/repos/andela/getmyshop/assignees{/user}","branches_url":"https://api.github.com/repos/andela/getmyshop/branches{/branch}","tags_url":"https://api.github.com/repos/andela/getmyshop/tags","blobs_url":"https://api.github.com/repos/andela/getmyshop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/getmyshop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/getmyshop/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/getmyshop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/getmyshop/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/getmyshop/languages","stargazers_url":"https://api.github.com/repos/andela/getmyshop/stargazers","contributors_url":"https://api.github.com/repos/andela/getmyshop/contributors","subscribers_url":"https://api.github.com/repos/andela/getmyshop/subscribers","subscription_url":"https://api.github.com/repos/andela/getmyshop/subscription","commits_url":"https://api.github.com/repos/andela/getmyshop/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/getmyshop/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/getmyshop/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/getmyshop/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/getmyshop/contents/{+path}","compare_url":"https://api.github.com/repos/andela/getmyshop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/getmyshop/merges","archive_url":"https://api.github.com/repos/andela/getmyshop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/getmyshop/downloads","issues_url":"https://api.github.com/repos/andela/getmyshop/issues{/number}","pulls_url":"https://api.github.com/repos/andela/getmyshop/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/getmyshop/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/getmyshop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/getmyshop/labels{/name}","releases_url":"https://api.github.com/repos/andela/getmyshop/releases{/id}","deployments_url":"https://api.github.com/repos/andela/getmyshop/deployments","created_at":"2015-11-09T10:22:52Z","updated_at":"2016-03-01T11:23:55Z","pushed_at":"2016-03-08T15:16:00Z","git_url":"git://github.com/andela/getmyshop.git","ssh_url":"git@github.com:andela/getmyshop.git","clone_url":"https://github.com/andela/getmyshop.git","svn_url":"https://github.com/andela/getmyshop","homepage":null,"size":1188,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/andela/getmyshop/pulls/63"},"html":{"href":"https://github.com/andela/getmyshop/pull/63"},"issue":{"href":"https://api.github.com/repos/andela/getmyshop/issues/63"},"comments":{"href":"https://api.github.com/repos/andela/getmyshop/issues/63/comments"},"review_comments":{"href":"https://api.github.com/repos/andela/getmyshop/pulls/63/comments"},"review_comment":{"href":"https://api.github.com/repos/andela/getmyshop/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela/getmyshop/pulls/63/commits"},"statuses":{"href":"https://api.github.com/repos/andela/getmyshop/statuses/7f8f567886c8a38d1b99c1808e6e84790e49536c"}}}}