{"action":"created","comment":{"url":"https://api.github.com/repos/npauzenga/Blocitoff/pulls/comments/46064492","id":46064492,"diff_hunk":"@@ -0,0 +1,138 @@\n+require \"rails_helper\"\n+\n+RSpec.describe PasswordResetsController, type: :controller do\n+  let(:user) do\n+    create(:confirmed_user, reset_token: SecureRandom.urlsafe_base64.to_s)\n+  end\n+\n+  describe \"GET #new\" do\n+    context \"when successful\" do\n+      it \"returns http status 200\" do\n+        get :new\n+        expect(response).to have_http_status(200)\n+      end\n+\n+      it \"renders the #new template\" do\n+        get :new\n+        expect(response).to render_template :new\n+      end\n+    end\n+  end\n+\n+  describe \"POST #create\" do\n+    let(:params)    { { password_reset: { email: user.email } } }\n+    let(:arguments) { { email: user.email } }\n+    let(:context)   { double(:context, success?: true) }\n+\n+    before(:example) do\n+      allow(RequestPasswordResetToken).to receive(:call).with(arguments)\n+        .and_return(context)\n+    end\n+\n+    context \"when valid params are given\" do\n+      it \"calls the RequestPasswordResetToken interactor\" do\n+        expect(RequestPasswordResetToken).to receive(:call)\n+        post :create, params\n+      end\n+\n+      it \"returns http status 302\" do\n+        post :create, params\n+        expect(response).to have_http_status(302)\n+      end\n+\n+      it \"redirects to sign in\" do\n+        expect(post :create, params).to redirect_to(root_url)\n+      end\n+    end\n+\n+    context \"when invalid invalid params are passed\" do\n+      let(:context) { double(:context, success?: false) }\n+\n+      it \"renders to #new template\" do\n+        expect(post :create, params).to render_template(:new)\n+      end\n+    end\n+  end\n+\n+  describe \"GET #edit\" do\n+    context \"when successful\" do\n+      let(:params)    { { id: user.reset_token, email: user.email } }\n+\n+      let(:arguments) do\n+        { user: User.find_by(email: params[:email]),\n+          id:   user.reset_token }\n+      end\n+\n+      let(:context) { double(:context, success?: true, user: user) }\n+\n+      before(:example) do\n+        allow(VerifyPasswordResetUser).to receive(:call).with(arguments)\n+          .and_return(context)\n+      end\n+\n+      it \"returns http status 200\" do\n+        get :edit, params\n+        expect(response).to have_http_status(200)\n+      end\n+\n+      it \"renders the #new template\" do\n+        get :edit, params\n+        expect(response).to render_template :edit\n+      end\n+    end\n+  end\n+\n+  describe \"PATCH #update\" do\n+    let(:verify_pw_input) do\n+      { user: User.find_by(email: params[:email]),\n+        id:   user.reset_token }\n+    end\n+\n+    let(:params) do\n+      { user:  reset_pw_input.fetch(:user_params),\n+        email: user.email,\n+        id:    user.reset_token }\n+    end\n+\n+    let(:user_params) do\n+      { password:              user.password,\n+        password_confirmation: user.password_confirmation }\n+    end\n+\n+    let(:reset_pw_input) { { user_params: user_params, user: user } }\n+\n+    before(:example) do\n+      allow(VerifyPasswordResetUser).to receive(:call).with(verify_pw_input)\n+        .and_return(context)\n+\n+      allow(UpdatePassword).to receive(:call).with(reset_pw_input)\n+        .and_return(context)","path":"spec/controllers/password_resets_controller_spec.rb","position":109,"original_position":109,"commit_id":"bc0d021ec99083cf980aef14fd7a55eb4bd06af1","original_commit_id":"bc0d021ec99083cf980aef14fd7a55eb4bd06af1","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":"Place the . on the previous line, together with the method call receiver.","created_at":"2015-11-27T18:02:55Z","updated_at":"2015-11-27T18:02:55Z","html_url":"https://github.com/npauzenga/Blocitoff/pull/25#discussion_r46064492","pull_request_url":"https://api.github.com/repos/npauzenga/Blocitoff/pulls/25","_links":{"self":{"href":"https://api.github.com/repos/npauzenga/Blocitoff/pulls/comments/46064492"},"html":{"href":"https://github.com/npauzenga/Blocitoff/pull/25#discussion_r46064492"},"pull_request":{"href":"https://api.github.com/repos/npauzenga/Blocitoff/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/npauzenga/Blocitoff/pulls/25","id":51468705,"html_url":"https://github.com/npauzenga/Blocitoff/pull/25","diff_url":"https://github.com/npauzenga/Blocitoff/pull/25.diff","patch_url":"https://github.com/npauzenga/Blocitoff/pull/25.patch","issue_url":"https://api.github.com/repos/npauzenga/Blocitoff/issues/25","number":25,"state":"open","locked":false,"title":"Tasks/password resets controller spec","user":{"login":"npauzenga","id":5838826,"avatar_url":"https://avatars.githubusercontent.com/u/5838826?v=3","gravatar_id":"","url":"https://api.github.com/users/npauzenga","html_url":"https://github.com/npauzenga","followers_url":"https://api.github.com/users/npauzenga/followers","following_url":"https://api.github.com/users/npauzenga/following{/other_user}","gists_url":"https://api.github.com/users/npauzenga/gists{/gist_id}","starred_url":"https://api.github.com/users/npauzenga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npauzenga/subscriptions","organizations_url":"https://api.github.com/users/npauzenga/orgs","repos_url":"https://api.github.com/users/npauzenga/repos","events_url":"https://api.github.com/users/npauzenga/events{/privacy}","received_events_url":"https://api.github.com/users/npauzenga/received_events","type":"User","site_admin":false},"body":"Check out a few more controller specs @Enriikke! \r\n\r\nIt __may__ look like I cheated slightly by altering the `ResetPassword` flow and I __was__ having trouble passing the entire session hash to the interactors in our tests. The more I think about it though, I don't believe that was good idea in the first place. I refactored slightly so that, after a password reset, you're redirected to log in instead of immediately and automatically logged in with your new credentials.","created_at":"2015-11-22T16:48:34Z","updated_at":"2015-11-27T18:02:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"736210e1b1fdc510903891a1803ec0046036cd20","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/npauzenga/Blocitoff/pulls/25/commits","review_comments_url":"https://api.github.com/repos/npauzenga/Blocitoff/pulls/25/comments","review_comment_url":"https://api.github.com/repos/npauzenga/Blocitoff/pulls/comments{/number}","comments_url":"https://api.github.com/repos/npauzenga/Blocitoff/issues/25/comments","statuses_url":"https://api.github.com/repos/npauzenga/Blocitoff/statuses/bc0d021ec99083cf980aef14fd7a55eb4bd06af1","head":{"label":"npauzenga:tasks/password_resets_controller_spec","ref":"tasks/password_resets_controller_spec","sha":"bc0d021ec99083cf980aef14fd7a55eb4bd06af1","user":{"login":"npauzenga","id":5838826,"avatar_url":"https://avatars.githubusercontent.com/u/5838826?v=3","gravatar_id":"","url":"https://api.github.com/users/npauzenga","html_url":"https://github.com/npauzenga","followers_url":"https://api.github.com/users/npauzenga/followers","following_url":"https://api.github.com/users/npauzenga/following{/other_user}","gists_url":"https://api.github.com/users/npauzenga/gists{/gist_id}","starred_url":"https://api.github.com/users/npauzenga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npauzenga/subscriptions","organizations_url":"https://api.github.com/users/npauzenga/orgs","repos_url":"https://api.github.com/users/npauzenga/repos","events_url":"https://api.github.com/users/npauzenga/events{/privacy}","received_events_url":"https://api.github.com/users/npauzenga/received_events","type":"User","site_admin":false},"repo":{"id":44644608,"name":"Blocitoff","full_name":"npauzenga/Blocitoff","owner":{"login":"npauzenga","id":5838826,"avatar_url":"https://avatars.githubusercontent.com/u/5838826?v=3","gravatar_id":"","url":"https://api.github.com/users/npauzenga","html_url":"https://github.com/npauzenga","followers_url":"https://api.github.com/users/npauzenga/followers","following_url":"https://api.github.com/users/npauzenga/following{/other_user}","gists_url":"https://api.github.com/users/npauzenga/gists{/gist_id}","starred_url":"https://api.github.com/users/npauzenga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npauzenga/subscriptions","organizations_url":"https://api.github.com/users/npauzenga/orgs","repos_url":"https://api.github.com/users/npauzenga/repos","events_url":"https://api.github.com/users/npauzenga/events{/privacy}","received_events_url":"https://api.github.com/users/npauzenga/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/npauzenga/Blocitoff","description":"Self-destructing To-Do list app with rake automation","fork":false,"url":"https://api.github.com/repos/npauzenga/Blocitoff","forks_url":"https://api.github.com/repos/npauzenga/Blocitoff/forks","keys_url":"https://api.github.com/repos/npauzenga/Blocitoff/keys{/key_id}","collaborators_url":"https://api.github.com/repos/npauzenga/Blocitoff/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/npauzenga/Blocitoff/teams","hooks_url":"https://api.github.com/repos/npauzenga/Blocitoff/hooks","issue_events_url":"https://api.github.com/repos/npauzenga/Blocitoff/issues/events{/number}","events_url":"https://api.github.com/repos/npauzenga/Blocitoff/events","assignees_url":"https://api.github.com/repos/npauzenga/Blocitoff/assignees{/user}","branches_url":"https://api.github.com/repos/npauzenga/Blocitoff/branches{/branch}","tags_url":"https://api.github.com/repos/npauzenga/Blocitoff/tags","blobs_url":"https://api.github.com/repos/npauzenga/Blocitoff/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/npauzenga/Blocitoff/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/npauzenga/Blocitoff/git/refs{/sha}","trees_url":"https://api.github.com/repos/npauzenga/Blocitoff/git/trees{/sha}","statuses_url":"https://api.github.com/repos/npauzenga/Blocitoff/statuses/{sha}","languages_url":"https://api.github.com/repos/npauzenga/Blocitoff/languages","stargazers_url":"https://api.github.com/repos/npauzenga/Blocitoff/stargazers","contributors_url":"https://api.github.com/repos/npauzenga/Blocitoff/contributors","subscribers_url":"https://api.github.com/repos/npauzenga/Blocitoff/subscribers","subscription_url":"https://api.github.com/repos/npauzenga/Blocitoff/subscription","commits_url":"https://api.github.com/repos/npauzenga/Blocitoff/commits{/sha}","git_commits_url":"https://api.github.com/repos/npauzenga/Blocitoff/git/commits{/sha}","comments_url":"https://api.github.com/repos/npauzenga/Blocitoff/comments{/number}","issue_comment_url":"https://api.github.com/repos/npauzenga/Blocitoff/issues/comments{/number}","contents_url":"https://api.github.com/repos/npauzenga/Blocitoff/contents/{+path}","compare_url":"https://api.github.com/repos/npauzenga/Blocitoff/compare/{base}...{head}","merges_url":"https://api.github.com/repos/npauzenga/Blocitoff/merges","archive_url":"https://api.github.com/repos/npauzenga/Blocitoff/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/npauzenga/Blocitoff/downloads","issues_url":"https://api.github.com/repos/npauzenga/Blocitoff/issues{/number}","pulls_url":"https://api.github.com/repos/npauzenga/Blocitoff/pulls{/number}","milestones_url":"https://api.github.com/repos/npauzenga/Blocitoff/milestones{/number}","notifications_url":"https://api.github.com/repos/npauzenga/Blocitoff/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/npauzenga/Blocitoff/labels{/name}","releases_url":"https://api.github.com/repos/npauzenga/Blocitoff/releases{/id}","created_at":"2015-10-21T01:16:04Z","updated_at":"2015-10-21T17:56:13Z","pushed_at":"2015-11-27T18:02:52Z","git_url":"git://github.com/npauzenga/Blocitoff.git","ssh_url":"git@github.com:npauzenga/Blocitoff.git","clone_url":"https://github.com/npauzenga/Blocitoff.git","svn_url":"https://github.com/npauzenga/Blocitoff","homepage":null,"size":153,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":8,"forks":0,"open_issues":8,"watchers":0,"default_branch":"master"}},"base":{"label":"npauzenga:staging","ref":"staging","sha":"cb75e67e2f3bda13de260fb3a4558e12d9179754","user":{"login":"npauzenga","id":5838826,"avatar_url":"https://avatars.githubusercontent.com/u/5838826?v=3","gravatar_id":"","url":"https://api.github.com/users/npauzenga","html_url":"https://github.com/npauzenga","followers_url":"https://api.github.com/users/npauzenga/followers","following_url":"https://api.github.com/users/npauzenga/following{/other_user}","gists_url":"https://api.github.com/users/npauzenga/gists{/gist_id}","starred_url":"https://api.github.com/users/npauzenga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npauzenga/subscriptions","organizations_url":"https://api.github.com/users/npauzenga/orgs","repos_url":"https://api.github.com/users/npauzenga/repos","events_url":"https://api.github.com/users/npauzenga/events{/privacy}","received_events_url":"https://api.github.com/users/npauzenga/received_events","type":"User","site_admin":false},"repo":{"id":44644608,"name":"Blocitoff","full_name":"npauzenga/Blocitoff","owner":{"login":"npauzenga","id":5838826,"avatar_url":"https://avatars.githubusercontent.com/u/5838826?v=3","gravatar_id":"","url":"https://api.github.com/users/npauzenga","html_url":"https://github.com/npauzenga","followers_url":"https://api.github.com/users/npauzenga/followers","following_url":"https://api.github.com/users/npauzenga/following{/other_user}","gists_url":"https://api.github.com/users/npauzenga/gists{/gist_id}","starred_url":"https://api.github.com/users/npauzenga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npauzenga/subscriptions","organizations_url":"https://api.github.com/users/npauzenga/orgs","repos_url":"https://api.github.com/users/npauzenga/repos","events_url":"https://api.github.com/users/npauzenga/events{/privacy}","received_events_url":"https://api.github.com/users/npauzenga/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/npauzenga/Blocitoff","description":"Self-destructing To-Do list app with rake automation","fork":false,"url":"https://api.github.com/repos/npauzenga/Blocitoff","forks_url":"https://api.github.com/repos/npauzenga/Blocitoff/forks","keys_url":"https://api.github.com/repos/npauzenga/Blocitoff/keys{/key_id}","collaborators_url":"https://api.github.com/repos/npauzenga/Blocitoff/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/npauzenga/Blocitoff/teams","hooks_url":"https://api.github.com/repos/npauzenga/Blocitoff/hooks","issue_events_url":"https://api.github.com/repos/npauzenga/Blocitoff/issues/events{/number}","events_url":"https://api.github.com/repos/npauzenga/Blocitoff/events","assignees_url":"https://api.github.com/repos/npauzenga/Blocitoff/assignees{/user}","branches_url":"https://api.github.com/repos/npauzenga/Blocitoff/branches{/branch}","tags_url":"https://api.github.com/repos/npauzenga/Blocitoff/tags","blobs_url":"https://api.github.com/repos/npauzenga/Blocitoff/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/npauzenga/Blocitoff/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/npauzenga/Blocitoff/git/refs{/sha}","trees_url":"https://api.github.com/repos/npauzenga/Blocitoff/git/trees{/sha}","statuses_url":"https://api.github.com/repos/npauzenga/Blocitoff/statuses/{sha}","languages_url":"https://api.github.com/repos/npauzenga/Blocitoff/languages","stargazers_url":"https://api.github.com/repos/npauzenga/Blocitoff/stargazers","contributors_url":"https://api.github.com/repos/npauzenga/Blocitoff/contributors","subscribers_url":"https://api.github.com/repos/npauzenga/Blocitoff/subscribers","subscription_url":"https://api.github.com/repos/npauzenga/Blocitoff/subscription","commits_url":"https://api.github.com/repos/npauzenga/Blocitoff/commits{/sha}","git_commits_url":"https://api.github.com/repos/npauzenga/Blocitoff/git/commits{/sha}","comments_url":"https://api.github.com/repos/npauzenga/Blocitoff/comments{/number}","issue_comment_url":"https://api.github.com/repos/npauzenga/Blocitoff/issues/comments{/number}","contents_url":"https://api.github.com/repos/npauzenga/Blocitoff/contents/{+path}","compare_url":"https://api.github.com/repos/npauzenga/Blocitoff/compare/{base}...{head}","merges_url":"https://api.github.com/repos/npauzenga/Blocitoff/merges","archive_url":"https://api.github.com/repos/npauzenga/Blocitoff/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/npauzenga/Blocitoff/downloads","issues_url":"https://api.github.com/repos/npauzenga/Blocitoff/issues{/number}","pulls_url":"https://api.github.com/repos/npauzenga/Blocitoff/pulls{/number}","milestones_url":"https://api.github.com/repos/npauzenga/Blocitoff/milestones{/number}","notifications_url":"https://api.github.com/repos/npauzenga/Blocitoff/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/npauzenga/Blocitoff/labels{/name}","releases_url":"https://api.github.com/repos/npauzenga/Blocitoff/releases{/id}","created_at":"2015-10-21T01:16:04Z","updated_at":"2015-10-21T17:56:13Z","pushed_at":"2015-11-27T18:02:52Z","git_url":"git://github.com/npauzenga/Blocitoff.git","ssh_url":"git@github.com:npauzenga/Blocitoff.git","clone_url":"https://github.com/npauzenga/Blocitoff.git","svn_url":"https://github.com/npauzenga/Blocitoff","homepage":null,"size":153,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":8,"forks":0,"open_issues":8,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/npauzenga/Blocitoff/pulls/25"},"html":{"href":"https://github.com/npauzenga/Blocitoff/pull/25"},"issue":{"href":"https://api.github.com/repos/npauzenga/Blocitoff/issues/25"},"comments":{"href":"https://api.github.com/repos/npauzenga/Blocitoff/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/npauzenga/Blocitoff/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/npauzenga/Blocitoff/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/npauzenga/Blocitoff/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/npauzenga/Blocitoff/statuses/bc0d021ec99083cf980aef14fd7a55eb4bd06af1"}}}}