{"action":"created","comment":{"url":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/comments/48731312","id":48731312,"diff_hunk":"@@ -0,0 +1,81 @@\n+\n+feature 'password can be reset' do\n+\n+  before do\n+    sign_up\n+    Capybara.reset!\n+    allow(SendRecoverLink).to receive(:call)\n+  end\n+\n+  let(:user) { User.first }\n+\n+  scenario 'users can click \"forgotten password\" link' do\n+    visit '/sessions/new'\n+    click_link 'Forgotten password?'\n+    expect(page).to have_content \"Please enter your email address\"\n+  end\n+\n+  scenario 'users can enter email address' do\n+    recover_password\n+    expect(page).to have_content 'Thank you, please check your inbox'\n+  end\n+\n+  scenario 'users receive a reset token on sign up' do\n+    expect{recover_password}.to change {User.first.password_token}\n+  end\n+\n+  scenario 'tokens expire after an hour' do\n+    recover_password\n+    Timecop.travel(60*60*60) do\n+      visit(\"/users/reset_password?token=#{user.password_token}\")\n+      expect(page).to have_content \"Your token has expired\"\n+    end\n+  end\n+\n+  scenario 'user may reset passwords' do\n+    recover_password\n+    visit(\"/users/reset_password?token=#{user.password_token}\")\n+    expect(page).to have_content \"Please enter your new password\"\n+    end\n+\n+  scenario 'with a valid token, user may reset password' do\n+    recover_password\n+    visit(\"/users/reset_password?token=#{user.password_token}\")\n+    fill_in  :password, with: \"newpassword\"\n+    fill_in :password_confirmation, with: \"newpassword\"\n+    click_button \"Submit\"\n+    expect(page).to have_content \"Sign in to Chitter\"\n+  end\n+\n+\n+  scenario 'it lets you sign in after password reset' do\n+     recover_password\n+     visit(\"/users/reset_password?token=#{user.password_token}\")\n+     fill_in :password, with: \"newpassword\"\n+     fill_in :password_confirmation, with: \"newpassword\"\n+     click_button \"Submit\"\n+     sign_in(email: \"edwardkerry@gmail.com\", password: \"newpassword\")\n+     expect(page).to have_content \"Edward's Chitter!\"\n+   end\n+\n+  scenario 'it lets you know if passwords don\\'t match' do\n+     recover_password\n+     visit(\"/users/reset_password?token=#{user.password_token}\")\n+     fill_in :password, with: \"newpassword\"\n+     fill_in :password_confirmation, with: \"wrongpassword\"\n+     click_button \"Submit\"\n+     expect(page).to have_content(\"Password does not match the confirmation\")\n+   end\n+\n+   scenario 'it calls the SendRecoveryLink service to send the link' do\n+    expect(SendRecoverLink).to receive(:call).with(user)\n+    recover_password\n+  end","path":"spec/features/password_reset_spec.rb","position":73,"original_position":73,"commit_id":"03149b6e69210f1eea9291d1b11df0ee887ccce2","original_commit_id":"03149b6e69210f1eea9291d1b11df0ee887ccce2","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Lint/BlockAlignment: `end` at 73, 2 is not aligned with `scenario 'it calls the SendRecoveryLink service to send the link' do` at 70, 3.","created_at":"2016-01-04T13:45:22Z","updated_at":"2016-01-04T13:45:22Z","html_url":"https://github.com/makersacademy/chitter-challenge/pull/218#discussion_r48731312","pull_request_url":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/218","_links":{"self":{"href":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/comments/48731312"},"html":{"href":"https://github.com/makersacademy/chitter-challenge/pull/218#discussion_r48731312"},"pull_request":{"href":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/218"}}},"pull_request":{"url":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/218","id":54869053,"html_url":"https://github.com/makersacademy/chitter-challenge/pull/218","diff_url":"https://github.com/makersacademy/chitter-challenge/pull/218.diff","patch_url":"https://github.com/makersacademy/chitter-challenge/pull/218.patch","issue_url":"https://api.github.com/repos/makersacademy/chitter-challenge/issues/218","number":218,"state":"open","locked":false,"title":"Ed's Chitter Challenge","user":{"login":"edwardkerry","id":13475227,"avatar_url":"https://avatars.githubusercontent.com/u/13475227?v=3","gravatar_id":"","url":"https://api.github.com/users/edwardkerry","html_url":"https://github.com/edwardkerry","followers_url":"https://api.github.com/users/edwardkerry/followers","following_url":"https://api.github.com/users/edwardkerry/following{/other_user}","gists_url":"https://api.github.com/users/edwardkerry/gists{/gist_id}","starred_url":"https://api.github.com/users/edwardkerry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edwardkerry/subscriptions","organizations_url":"https://api.github.com/users/edwardkerry/orgs","repos_url":"https://api.github.com/users/edwardkerry/repos","events_url":"https://api.github.com/users/edwardkerry/events{/privacy}","received_events_url":"https://api.github.com/users/edwardkerry/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-31T15:54:36Z","updated_at":"2016-01-04T13:45:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6a65c601d3fb62486e9cea2566eec3eb913946bc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/218/commits","review_comments_url":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/218/comments","review_comment_url":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/comments{/number}","comments_url":"https://api.github.com/repos/makersacademy/chitter-challenge/issues/218/comments","statuses_url":"https://api.github.com/repos/makersacademy/chitter-challenge/statuses/03149b6e69210f1eea9291d1b11df0ee887ccce2","head":{"label":"edwardkerry:master","ref":"master","sha":"03149b6e69210f1eea9291d1b11df0ee887ccce2","user":{"login":"edwardkerry","id":13475227,"avatar_url":"https://avatars.githubusercontent.com/u/13475227?v=3","gravatar_id":"","url":"https://api.github.com/users/edwardkerry","html_url":"https://github.com/edwardkerry","followers_url":"https://api.github.com/users/edwardkerry/followers","following_url":"https://api.github.com/users/edwardkerry/following{/other_user}","gists_url":"https://api.github.com/users/edwardkerry/gists{/gist_id}","starred_url":"https://api.github.com/users/edwardkerry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edwardkerry/subscriptions","organizations_url":"https://api.github.com/users/edwardkerry/orgs","repos_url":"https://api.github.com/users/edwardkerry/repos","events_url":"https://api.github.com/users/edwardkerry/events{/privacy}","received_events_url":"https://api.github.com/users/edwardkerry/received_events","type":"User","site_admin":false},"repo":{"id":48700026,"name":"chitter-challenge","full_name":"edwardkerry/chitter-challenge","owner":{"login":"edwardkerry","id":13475227,"avatar_url":"https://avatars.githubusercontent.com/u/13475227?v=3","gravatar_id":"","url":"https://api.github.com/users/edwardkerry","html_url":"https://github.com/edwardkerry","followers_url":"https://api.github.com/users/edwardkerry/followers","following_url":"https://api.github.com/users/edwardkerry/following{/other_user}","gists_url":"https://api.github.com/users/edwardkerry/gists{/gist_id}","starred_url":"https://api.github.com/users/edwardkerry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edwardkerry/subscriptions","organizations_url":"https://api.github.com/users/edwardkerry/orgs","repos_url":"https://api.github.com/users/edwardkerry/repos","events_url":"https://api.github.com/users/edwardkerry/events{/privacy}","received_events_url":"https://api.github.com/users/edwardkerry/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/edwardkerry/chitter-challenge","description":"Build a Twitter Clone!","fork":true,"url":"https://api.github.com/repos/edwardkerry/chitter-challenge","forks_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/forks","keys_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/teams","hooks_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/hooks","issue_events_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/issues/events{/number}","events_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/events","assignees_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/assignees{/user}","branches_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/branches{/branch}","tags_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/tags","blobs_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/git/refs{/sha}","trees_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/statuses/{sha}","languages_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/languages","stargazers_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/stargazers","contributors_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/contributors","subscribers_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/subscribers","subscription_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/subscription","commits_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/commits{/sha}","git_commits_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/git/commits{/sha}","comments_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/comments{/number}","issue_comment_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/issues/comments{/number}","contents_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/contents/{+path}","compare_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/merges","archive_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/downloads","issues_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/issues{/number}","pulls_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/pulls{/number}","milestones_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/milestones{/number}","notifications_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/labels{/name}","releases_url":"https://api.github.com/repos/edwardkerry/chitter-challenge/releases{/id}","created_at":"2015-12-28T15:56:54Z","updated_at":"2015-12-28T15:56:54Z","pushed_at":"2016-01-04T13:45:14Z","git_url":"git://github.com/edwardkerry/chitter-challenge.git","ssh_url":"git@github.com:edwardkerry/chitter-challenge.git","clone_url":"https://github.com/edwardkerry/chitter-challenge.git","svn_url":"https://github.com/edwardkerry/chitter-challenge","homepage":null,"size":104,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"makersacademy:master","ref":"master","sha":"197661c9e9c3855ee1f464e804d754e0fdcd9994","user":{"login":"makersacademy","id":3636186,"avatar_url":"https://avatars.githubusercontent.com/u/3636186?v=3","gravatar_id":"","url":"https://api.github.com/users/makersacademy","html_url":"https://github.com/makersacademy","followers_url":"https://api.github.com/users/makersacademy/followers","following_url":"https://api.github.com/users/makersacademy/following{/other_user}","gists_url":"https://api.github.com/users/makersacademy/gists{/gist_id}","starred_url":"https://api.github.com/users/makersacademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makersacademy/subscriptions","organizations_url":"https://api.github.com/users/makersacademy/orgs","repos_url":"https://api.github.com/users/makersacademy/repos","events_url":"https://api.github.com/users/makersacademy/events{/privacy}","received_events_url":"https://api.github.com/users/makersacademy/received_events","type":"Organization","site_admin":false},"repo":{"id":26954706,"name":"chitter-challenge","full_name":"makersacademy/chitter-challenge","owner":{"login":"makersacademy","id":3636186,"avatar_url":"https://avatars.githubusercontent.com/u/3636186?v=3","gravatar_id":"","url":"https://api.github.com/users/makersacademy","html_url":"https://github.com/makersacademy","followers_url":"https://api.github.com/users/makersacademy/followers","following_url":"https://api.github.com/users/makersacademy/following{/other_user}","gists_url":"https://api.github.com/users/makersacademy/gists{/gist_id}","starred_url":"https://api.github.com/users/makersacademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makersacademy/subscriptions","organizations_url":"https://api.github.com/users/makersacademy/orgs","repos_url":"https://api.github.com/users/makersacademy/repos","events_url":"https://api.github.com/users/makersacademy/events{/privacy}","received_events_url":"https://api.github.com/users/makersacademy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/makersacademy/chitter-challenge","description":"Build a Twitter Clone!","fork":false,"url":"https://api.github.com/repos/makersacademy/chitter-challenge","forks_url":"https://api.github.com/repos/makersacademy/chitter-challenge/forks","keys_url":"https://api.github.com/repos/makersacademy/chitter-challenge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/makersacademy/chitter-challenge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/makersacademy/chitter-challenge/teams","hooks_url":"https://api.github.com/repos/makersacademy/chitter-challenge/hooks","issue_events_url":"https://api.github.com/repos/makersacademy/chitter-challenge/issues/events{/number}","events_url":"https://api.github.com/repos/makersacademy/chitter-challenge/events","assignees_url":"https://api.github.com/repos/makersacademy/chitter-challenge/assignees{/user}","branches_url":"https://api.github.com/repos/makersacademy/chitter-challenge/branches{/branch}","tags_url":"https://api.github.com/repos/makersacademy/chitter-challenge/tags","blobs_url":"https://api.github.com/repos/makersacademy/chitter-challenge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/makersacademy/chitter-challenge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/makersacademy/chitter-challenge/git/refs{/sha}","trees_url":"https://api.github.com/repos/makersacademy/chitter-challenge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/makersacademy/chitter-challenge/statuses/{sha}","languages_url":"https://api.github.com/repos/makersacademy/chitter-challenge/languages","stargazers_url":"https://api.github.com/repos/makersacademy/chitter-challenge/stargazers","contributors_url":"https://api.github.com/repos/makersacademy/chitter-challenge/contributors","subscribers_url":"https://api.github.com/repos/makersacademy/chitter-challenge/subscribers","subscription_url":"https://api.github.com/repos/makersacademy/chitter-challenge/subscription","commits_url":"https://api.github.com/repos/makersacademy/chitter-challenge/commits{/sha}","git_commits_url":"https://api.github.com/repos/makersacademy/chitter-challenge/git/commits{/sha}","comments_url":"https://api.github.com/repos/makersacademy/chitter-challenge/comments{/number}","issue_comment_url":"https://api.github.com/repos/makersacademy/chitter-challenge/issues/comments{/number}","contents_url":"https://api.github.com/repos/makersacademy/chitter-challenge/contents/{+path}","compare_url":"https://api.github.com/repos/makersacademy/chitter-challenge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/makersacademy/chitter-challenge/merges","archive_url":"https://api.github.com/repos/makersacademy/chitter-challenge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/makersacademy/chitter-challenge/downloads","issues_url":"https://api.github.com/repos/makersacademy/chitter-challenge/issues{/number}","pulls_url":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls{/number}","milestones_url":"https://api.github.com/repos/makersacademy/chitter-challenge/milestones{/number}","notifications_url":"https://api.github.com/repos/makersacademy/chitter-challenge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/makersacademy/chitter-challenge/labels{/name}","releases_url":"https://api.github.com/repos/makersacademy/chitter-challenge/releases{/id}","created_at":"2014-11-21T09:53:31Z","updated_at":"2015-12-23T20:26:15Z","pushed_at":"2016-01-04T13:45:14Z","git_url":"git://github.com/makersacademy/chitter-challenge.git","ssh_url":"git@github.com:makersacademy/chitter-challenge.git","clone_url":"https://github.com/makersacademy/chitter-challenge.git","svn_url":"https://github.com/makersacademy/chitter-challenge","homepage":null,"size":47522,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":227,"mirror_url":null,"open_issues_count":23,"forks":227,"open_issues":23,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/218"},"html":{"href":"https://github.com/makersacademy/chitter-challenge/pull/218"},"issue":{"href":"https://api.github.com/repos/makersacademy/chitter-challenge/issues/218"},"comments":{"href":"https://api.github.com/repos/makersacademy/chitter-challenge/issues/218/comments"},"review_comments":{"href":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/218/comments"},"review_comment":{"href":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/218/commits"},"statuses":{"href":"https://api.github.com/repos/makersacademy/chitter-challenge/statuses/03149b6e69210f1eea9291d1b11df0ee887ccce2"}}}}