{"action":"created","comment":{"url":"https://api.github.com/repos/npauzenga/Blocitoff/pulls/comments/45548847","id":45548847,"diff_hunk":"@@ -3,11 +3,121 @@\n RSpec.describe UsersController, type: :controller do\n   let(:user) { create(:unconfirmed_user) }\n \n-  describe \"email confirmation\" do\n-    it \"sends a confirmation email when user registers\" do\n-      expect {\n-        UserMailer.registration_confirmation(user).deliver_now\n-      }.to change(ActionMailer::Base.deliveries, :size).by(1)\n+  describe \"GET #new\" do\n+    context \"when successful\" do\n+      it \"assigns new User to @user\" do\n+        get :new\n+        expect(assigns(:user)).to be_a_new(User)\n+      end\n+\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) { { user: interactor_input.fetch(:user_params) } }\n+\n+    let(:interactor_input) do\n+      { user_params: {\n+        name:                  user.name,\n+        email:                 user.email,\n+        password:              user.password,\n+        password_confirmation: user.password_confirmation }\n+      }\n+    end\n+\n+    let(:interactor_context) do\n+      Interactor::Context.new(errors: :val, user: user)\n+    end\n+\n+    before(:example) do\n+      allow(CreateUser).to receive(:call).with(interactor_input)\n+        .and_return(interactor_context)\n+    end\n+\n+    context \"when valid params are given\" do\n+      it \"calls the CreateUser interactor\" do\n+        expect(CreateUser).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(sign_in_path)\n+      end\n+    end\n+\n+    context \"when invalid invalid params are passed\" do\n+      before(:example) do\n+        allow(interactor_context).to receive(:success?) { false }\n+      end\n+\n+      it \"redirects to sign up\" do\n+        expect(post :create, params).to redirect_to(sign_up_path)\n+      end\n+    end\n+  end\n+\n+  describe \"GET #show\" do\n+    let(:confirmed_user_1) { create(:confirmed_user) }\n+    let(:current_user)     { create(:confirmed_user) }\n+    let(:params)           { { id: confirmed_user_1.id } }\n+    let(:session)          { { user_id: current_user.id } }\n+\n+    let(:arguments) do\n+      { id:         params.fetch(:id).to_s,\n+        current_id: session.fetch(:user_id) }\n+    end\n+\n+    let(:context) { double(:context, success?: true, user: confirmed_user_1) }\n+\n+    before(:example) do\n+      allow(ShowUser).to receive(:call).with(arguments)\n+        .and_return(context)","path":"spec/controllers/users_controller_spec.rb","position":91,"original_position":91,"commit_id":"40b724fe258aadd0be67f24166a1ed8fffb496af","original_commit_id":"40b724fe258aadd0be67f24166a1ed8fffb496af","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-21T18:08:05Z","updated_at":"2015-11-21T18:08:05Z","html_url":"https://github.com/npauzenga/Blocitoff/pull/21#discussion_r45548847","pull_request_url":"https://api.github.com/repos/npauzenga/Blocitoff/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/npauzenga/Blocitoff/pulls/comments/45548847"},"html":{"href":"https://github.com/npauzenga/Blocitoff/pull/21#discussion_r45548847"},"pull_request":{"href":"https://api.github.com/repos/npauzenga/Blocitoff/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/npauzenga/Blocitoff/pulls/21","id":50757451,"html_url":"https://github.com/npauzenga/Blocitoff/pull/21","diff_url":"https://github.com/npauzenga/Blocitoff/pull/21.diff","patch_url":"https://github.com/npauzenga/Blocitoff/pull/21.patch","issue_url":"https://api.github.com/repos/npauzenga/Blocitoff/issues/21","number":21,"state":"open","locked":false,"title":"testing POST #create, not working","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":"Hey @Enriikke, would you mind having a look at this spec? I'm a little stuck. The spec fails with --\r\n```\r\n  1) UsersController POST #create when valid params are given calls the CreateUser interactor\r\n     Failure/Error: post :create, interactor_input\r\n     NoMethodError:\r\n       undefined method `success?' for nil:NilClass\r\n```\r\n\r\nSo it's not returning a context. It's something to do with the strong parameters (`interactor_input`). If I remove that `.with` from the `before` block, the test passes but I don't think that's what we want. So two questions...\r\n\r\n1. Why does our `with` method not like `interactor_input`? \r\n2. If we lose `with`, `CreateUser` will still check to make sure our `user_params` are valid so why do we need to specify that we're going to receive `call` with these parameters in our `before` block?","created_at":"2015-11-15T21:49:25Z","updated_at":"2015-11-21T18:08:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4164e9d72f402a23ffb34089b1cb82da85254631","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/npauzenga/Blocitoff/pulls/21/commits","review_comments_url":"https://api.github.com/repos/npauzenga/Blocitoff/pulls/21/comments","review_comment_url":"https://api.github.com/repos/npauzenga/Blocitoff/pulls/comments{/number}","comments_url":"https://api.github.com/repos/npauzenga/Blocitoff/issues/21/comments","statuses_url":"https://api.github.com/repos/npauzenga/Blocitoff/statuses/40b724fe258aadd0be67f24166a1ed8fffb496af","head":{"label":"npauzenga:tasks/controller-specs","ref":"tasks/controller-specs","sha":"40b724fe258aadd0be67f24166a1ed8fffb496af","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-21T18:08:00Z","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":126,"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":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"npauzenga:tasks/refactor-user","ref":"tasks/refactor-user","sha":"eed580043fbae456a15f6812d1b237e7678ee475","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-21T18:08:00Z","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":126,"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":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/npauzenga/Blocitoff/pulls/21"},"html":{"href":"https://github.com/npauzenga/Blocitoff/pull/21"},"issue":{"href":"https://api.github.com/repos/npauzenga/Blocitoff/issues/21"},"comments":{"href":"https://api.github.com/repos/npauzenga/Blocitoff/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/npauzenga/Blocitoff/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/npauzenga/Blocitoff/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/npauzenga/Blocitoff/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/npauzenga/Blocitoff/statuses/40b724fe258aadd0be67f24166a1ed8fffb496af"}}}}