{"action":"created","comment":{"url":"https://api.github.com/repos/danReynolds/SupermarKit/pulls/comments/94265163","pull_request_review_id":14796414,"id":94265163,"diff_hunk":"@@ -0,0 +1,132 @@\n+require 'rails_helper'\n+require 'support/basic_user'\n+require 'support/routes'\n+\n+describe Groceries::CheckoutsController, type: :controller do\n+  include_context 'basic user'\n+\n+  let(:grocery_id) { grocery.id }\n+  it_should_behave_like 'routes', {\n+    show: { grocery_id: true }\n+  }\n+\n+  describe 'POST create' do\n+    subject { post :create, params: params }\n+    let (:payments) { [] }\n+    let(:params) {\n+      {\n+        grocery_id: grocery_id,\n+        grocery: {}\n+      }\n+    }\n+\n+    before :each do\n+      other_user = create(:user)\n+      grocery.user_group.users << other_user\n+      params[:grocery][:payments] = grocery.user_group.users.map.with_index do |user, i|\n+        {\n+          user_id: user.id,\n+          price: i\n+        }\n+      end\n+    end\n+\n+    it 'should finish the grocery list' do\n+      expect(grocery.finished?).to eq false\n+      subject\n+      expect(grocery.reload.finished?).to eq true\n+    end\n+\n+    context 'slack messages' do\n+      before :each do\n+        @slack_bot = create(:slack_bot, :with_messages)\n+        allow(@slack_bot).to receive(:send_message)\n+        allow(Grocery).to receive(:find).and_return(grocery)\n+        allow(grocery).to receive_message_chain(:save!).and_return(true)\n+        allow(grocery).to receive_message_chain(:user_group, :slack_bot).and_return(@slack_bot)\n+      end\n+\n+      context 'with a slackbot' do\n+        context 'with a receipt' do\n+          it 'should send a receipt and checkout message' do\n+            allow(grocery).to receive_message_chain(:receipt, :present?).and_return(true)\n+\n+            subject\n+            expect(@slack_bot).to have_received(:send_message)\n+            .with(SlackMessage::SEND_CHECKOUT_MESSAGE, grocery)\n+            expect(@slack_bot).to have_received(:send_message)\n+            .with(SlackMessage::SEND_GROCERY_RECEIPT, grocery)\n+          end\n+        end\n+\n+        context 'without a receipt' do\n+          it 'should send a checkout message' do\n+            subject\n+            expect(@slack_bot).to have_received(:send_message)\n+            .with(SlackMessage::SEND_CHECKOUT_MESSAGE, grocery)\n+          end\n+        end\n+      end\n+\n+      context 'without a slackbot' do\n+        it 'should not send any slack messages' do\n+          allow(grocery).to receive_message_chain(:user_group, :slack_bot).and_return(nil)\n+          subject\n+          expect(@slack_bot).to_not have_received(:send_message)\n+          .with(SlackMessage::SEND_CHECKOUT_MESSAGE, grocery)\n+          expect(@slack_bot).to_not have_received(:send_message)\n+          .with(SlackMessage::SEND_GROCERY_RECEIPT, grocery)\n+        end\n+      end\n+    end\n+\n+","path":"spec/controllers/groceries/checkouts_controller_spec.rb","position":83,"original_position":83,"commit_id":"970a03eddf36d22bdf2204f93dbe2bd836842be9","original_commit_id":"970a03eddf36d22bdf2204f93dbe2bd836842be9","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":"Extra blank line detected.","created_at":"2016-12-31T00:00:55Z","updated_at":"2016-12-31T00:00:55Z","html_url":"https://github.com/danReynolds/SupermarKit/pull/148#discussion_r94265163","pull_request_url":"https://api.github.com/repos/danReynolds/SupermarKit/pulls/148","_links":{"self":{"href":"https://api.github.com/repos/danReynolds/SupermarKit/pulls/comments/94265163"},"html":{"href":"https://github.com/danReynolds/SupermarKit/pull/148#discussion_r94265163"},"pull_request":{"href":"https://api.github.com/repos/danReynolds/SupermarKit/pulls/148"}}},"pull_request":{"url":"https://api.github.com/repos/danReynolds/SupermarKit/pulls/148","id":99789974,"html_url":"https://github.com/danReynolds/SupermarKit/pull/148","diff_url":"https://github.com/danReynolds/SupermarKit/pull/148.diff","patch_url":"https://github.com/danReynolds/SupermarKit/pull/148.patch","issue_url":"https://api.github.com/repos/danReynolds/SupermarKit/issues/148","number":148,"state":"open","locked":false,"title":"Move Checkout to subcontroller","user":{"login":"danReynolds","id":2192930,"avatar_url":"https://avatars.githubusercontent.com/u/2192930?v=3","gravatar_id":"","url":"https://api.github.com/users/danReynolds","html_url":"https://github.com/danReynolds","followers_url":"https://api.github.com/users/danReynolds/followers","following_url":"https://api.github.com/users/danReynolds/following{/other_user}","gists_url":"https://api.github.com/users/danReynolds/gists{/gist_id}","starred_url":"https://api.github.com/users/danReynolds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danReynolds/subscriptions","organizations_url":"https://api.github.com/users/danReynolds/orgs","repos_url":"https://api.github.com/users/danReynolds/repos","events_url":"https://api.github.com/users/danReynolds/events{/privacy}","received_events_url":"https://api.github.com/users/danReynolds/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-30T23:19:30Z","updated_at":"2016-12-31T00:00:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1e132c916ecea61f22b8a6600998c5ab7b133bf1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/danReynolds/SupermarKit/pulls/148/commits","review_comments_url":"https://api.github.com/repos/danReynolds/SupermarKit/pulls/148/comments","review_comment_url":"https://api.github.com/repos/danReynolds/SupermarKit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/danReynolds/SupermarKit/issues/148/comments","statuses_url":"https://api.github.com/repos/danReynolds/SupermarKit/statuses/970a03eddf36d22bdf2204f93dbe2bd836842be9","head":{"label":"danReynolds:feature/moveCheckoutRoutes","ref":"feature/moveCheckoutRoutes","sha":"970a03eddf36d22bdf2204f93dbe2bd836842be9","user":{"login":"danReynolds","id":2192930,"avatar_url":"https://avatars.githubusercontent.com/u/2192930?v=3","gravatar_id":"","url":"https://api.github.com/users/danReynolds","html_url":"https://github.com/danReynolds","followers_url":"https://api.github.com/users/danReynolds/followers","following_url":"https://api.github.com/users/danReynolds/following{/other_user}","gists_url":"https://api.github.com/users/danReynolds/gists{/gist_id}","starred_url":"https://api.github.com/users/danReynolds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danReynolds/subscriptions","organizations_url":"https://api.github.com/users/danReynolds/orgs","repos_url":"https://api.github.com/users/danReynolds/repos","events_url":"https://api.github.com/users/danReynolds/events{/privacy}","received_events_url":"https://api.github.com/users/danReynolds/received_events","type":"User","site_admin":false},"repo":{"id":27952521,"name":"SupermarKit","full_name":"danReynolds/SupermarKit","owner":{"login":"danReynolds","id":2192930,"avatar_url":"https://avatars.githubusercontent.com/u/2192930?v=3","gravatar_id":"","url":"https://api.github.com/users/danReynolds","html_url":"https://github.com/danReynolds","followers_url":"https://api.github.com/users/danReynolds/followers","following_url":"https://api.github.com/users/danReynolds/following{/other_user}","gists_url":"https://api.github.com/users/danReynolds/gists{/gist_id}","starred_url":"https://api.github.com/users/danReynolds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danReynolds/subscriptions","organizations_url":"https://api.github.com/users/danReynolds/orgs","repos_url":"https://api.github.com/users/danReynolds/repos","events_url":"https://api.github.com/users/danReynolds/events{/privacy}","received_events_url":"https://api.github.com/users/danReynolds/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danReynolds/SupermarKit","description":"SupermarKit - a grocery tracking and management app","fork":false,"url":"https://api.github.com/repos/danReynolds/SupermarKit","forks_url":"https://api.github.com/repos/danReynolds/SupermarKit/forks","keys_url":"https://api.github.com/repos/danReynolds/SupermarKit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danReynolds/SupermarKit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danReynolds/SupermarKit/teams","hooks_url":"https://api.github.com/repos/danReynolds/SupermarKit/hooks","issue_events_url":"https://api.github.com/repos/danReynolds/SupermarKit/issues/events{/number}","events_url":"https://api.github.com/repos/danReynolds/SupermarKit/events","assignees_url":"https://api.github.com/repos/danReynolds/SupermarKit/assignees{/user}","branches_url":"https://api.github.com/repos/danReynolds/SupermarKit/branches{/branch}","tags_url":"https://api.github.com/repos/danReynolds/SupermarKit/tags","blobs_url":"https://api.github.com/repos/danReynolds/SupermarKit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danReynolds/SupermarKit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danReynolds/SupermarKit/git/refs{/sha}","trees_url":"https://api.github.com/repos/danReynolds/SupermarKit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danReynolds/SupermarKit/statuses/{sha}","languages_url":"https://api.github.com/repos/danReynolds/SupermarKit/languages","stargazers_url":"https://api.github.com/repos/danReynolds/SupermarKit/stargazers","contributors_url":"https://api.github.com/repos/danReynolds/SupermarKit/contributors","subscribers_url":"https://api.github.com/repos/danReynolds/SupermarKit/subscribers","subscription_url":"https://api.github.com/repos/danReynolds/SupermarKit/subscription","commits_url":"https://api.github.com/repos/danReynolds/SupermarKit/commits{/sha}","git_commits_url":"https://api.github.com/repos/danReynolds/SupermarKit/git/commits{/sha}","comments_url":"https://api.github.com/repos/danReynolds/SupermarKit/comments{/number}","issue_comment_url":"https://api.github.com/repos/danReynolds/SupermarKit/issues/comments{/number}","contents_url":"https://api.github.com/repos/danReynolds/SupermarKit/contents/{+path}","compare_url":"https://api.github.com/repos/danReynolds/SupermarKit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danReynolds/SupermarKit/merges","archive_url":"https://api.github.com/repos/danReynolds/SupermarKit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danReynolds/SupermarKit/downloads","issues_url":"https://api.github.com/repos/danReynolds/SupermarKit/issues{/number}","pulls_url":"https://api.github.com/repos/danReynolds/SupermarKit/pulls{/number}","milestones_url":"https://api.github.com/repos/danReynolds/SupermarKit/milestones{/number}","notifications_url":"https://api.github.com/repos/danReynolds/SupermarKit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danReynolds/SupermarKit/labels{/name}","releases_url":"https://api.github.com/repos/danReynolds/SupermarKit/releases{/id}","deployments_url":"https://api.github.com/repos/danReynolds/SupermarKit/deployments","created_at":"2014-12-13T06:56:32Z","updated_at":"2016-10-28T05:56:19Z","pushed_at":"2016-12-31T00:00:44Z","git_url":"git://github.com/danReynolds/SupermarKit.git","ssh_url":"git@github.com:danReynolds/SupermarKit.git","clone_url":"https://github.com/danReynolds/SupermarKit.git","svn_url":"https://github.com/danReynolds/SupermarKit","homepage":"https://supermarkit.io","size":107962,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5,"mirror_url":null,"open_issues_count":18,"forks":5,"open_issues":18,"watchers":4,"default_branch":"master"}},"base":{"label":"danReynolds:master","ref":"master","sha":"93365840bc24d9a141587604b0cae2bf4e9a4af0","user":{"login":"danReynolds","id":2192930,"avatar_url":"https://avatars.githubusercontent.com/u/2192930?v=3","gravatar_id":"","url":"https://api.github.com/users/danReynolds","html_url":"https://github.com/danReynolds","followers_url":"https://api.github.com/users/danReynolds/followers","following_url":"https://api.github.com/users/danReynolds/following{/other_user}","gists_url":"https://api.github.com/users/danReynolds/gists{/gist_id}","starred_url":"https://api.github.com/users/danReynolds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danReynolds/subscriptions","organizations_url":"https://api.github.com/users/danReynolds/orgs","repos_url":"https://api.github.com/users/danReynolds/repos","events_url":"https://api.github.com/users/danReynolds/events{/privacy}","received_events_url":"https://api.github.com/users/danReynolds/received_events","type":"User","site_admin":false},"repo":{"id":27952521,"name":"SupermarKit","full_name":"danReynolds/SupermarKit","owner":{"login":"danReynolds","id":2192930,"avatar_url":"https://avatars.githubusercontent.com/u/2192930?v=3","gravatar_id":"","url":"https://api.github.com/users/danReynolds","html_url":"https://github.com/danReynolds","followers_url":"https://api.github.com/users/danReynolds/followers","following_url":"https://api.github.com/users/danReynolds/following{/other_user}","gists_url":"https://api.github.com/users/danReynolds/gists{/gist_id}","starred_url":"https://api.github.com/users/danReynolds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danReynolds/subscriptions","organizations_url":"https://api.github.com/users/danReynolds/orgs","repos_url":"https://api.github.com/users/danReynolds/repos","events_url":"https://api.github.com/users/danReynolds/events{/privacy}","received_events_url":"https://api.github.com/users/danReynolds/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danReynolds/SupermarKit","description":"SupermarKit - a grocery tracking and management app","fork":false,"url":"https://api.github.com/repos/danReynolds/SupermarKit","forks_url":"https://api.github.com/repos/danReynolds/SupermarKit/forks","keys_url":"https://api.github.com/repos/danReynolds/SupermarKit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danReynolds/SupermarKit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danReynolds/SupermarKit/teams","hooks_url":"https://api.github.com/repos/danReynolds/SupermarKit/hooks","issue_events_url":"https://api.github.com/repos/danReynolds/SupermarKit/issues/events{/number}","events_url":"https://api.github.com/repos/danReynolds/SupermarKit/events","assignees_url":"https://api.github.com/repos/danReynolds/SupermarKit/assignees{/user}","branches_url":"https://api.github.com/repos/danReynolds/SupermarKit/branches{/branch}","tags_url":"https://api.github.com/repos/danReynolds/SupermarKit/tags","blobs_url":"https://api.github.com/repos/danReynolds/SupermarKit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danReynolds/SupermarKit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danReynolds/SupermarKit/git/refs{/sha}","trees_url":"https://api.github.com/repos/danReynolds/SupermarKit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danReynolds/SupermarKit/statuses/{sha}","languages_url":"https://api.github.com/repos/danReynolds/SupermarKit/languages","stargazers_url":"https://api.github.com/repos/danReynolds/SupermarKit/stargazers","contributors_url":"https://api.github.com/repos/danReynolds/SupermarKit/contributors","subscribers_url":"https://api.github.com/repos/danReynolds/SupermarKit/subscribers","subscription_url":"https://api.github.com/repos/danReynolds/SupermarKit/subscription","commits_url":"https://api.github.com/repos/danReynolds/SupermarKit/commits{/sha}","git_commits_url":"https://api.github.com/repos/danReynolds/SupermarKit/git/commits{/sha}","comments_url":"https://api.github.com/repos/danReynolds/SupermarKit/comments{/number}","issue_comment_url":"https://api.github.com/repos/danReynolds/SupermarKit/issues/comments{/number}","contents_url":"https://api.github.com/repos/danReynolds/SupermarKit/contents/{+path}","compare_url":"https://api.github.com/repos/danReynolds/SupermarKit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danReynolds/SupermarKit/merges","archive_url":"https://api.github.com/repos/danReynolds/SupermarKit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danReynolds/SupermarKit/downloads","issues_url":"https://api.github.com/repos/danReynolds/SupermarKit/issues{/number}","pulls_url":"https://api.github.com/repos/danReynolds/SupermarKit/pulls{/number}","milestones_url":"https://api.github.com/repos/danReynolds/SupermarKit/milestones{/number}","notifications_url":"https://api.github.com/repos/danReynolds/SupermarKit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danReynolds/SupermarKit/labels{/name}","releases_url":"https://api.github.com/repos/danReynolds/SupermarKit/releases{/id}","deployments_url":"https://api.github.com/repos/danReynolds/SupermarKit/deployments","created_at":"2014-12-13T06:56:32Z","updated_at":"2016-10-28T05:56:19Z","pushed_at":"2016-12-31T00:00:44Z","git_url":"git://github.com/danReynolds/SupermarKit.git","ssh_url":"git@github.com:danReynolds/SupermarKit.git","clone_url":"https://github.com/danReynolds/SupermarKit.git","svn_url":"https://github.com/danReynolds/SupermarKit","homepage":"https://supermarkit.io","size":107962,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5,"mirror_url":null,"open_issues_count":18,"forks":5,"open_issues":18,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/danReynolds/SupermarKit/pulls/148"},"html":{"href":"https://github.com/danReynolds/SupermarKit/pull/148"},"issue":{"href":"https://api.github.com/repos/danReynolds/SupermarKit/issues/148"},"comments":{"href":"https://api.github.com/repos/danReynolds/SupermarKit/issues/148/comments"},"review_comments":{"href":"https://api.github.com/repos/danReynolds/SupermarKit/pulls/148/comments"},"review_comment":{"href":"https://api.github.com/repos/danReynolds/SupermarKit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/danReynolds/SupermarKit/pulls/148/commits"},"statuses":{"href":"https://api.github.com/repos/danReynolds/SupermarKit/statuses/970a03eddf36d22bdf2204f93dbe2bd836842be9"}}}}
{"actor":{"display_login":"houndci-bot"}}