Skip to content

Commit

Permalink
Hoist common username to |expected_reviewer|
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-w committed Dec 11, 2015
1 parent 624898b commit d65838c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions spec/lita/handlers/reviewme_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,16 @@
it "skips assigning to the GitHub PR owner" do
expect_any_instance_of(Octokit::Client).to receive(:pull_request)
.with(repo, id).and_return(pr)

expected_reviewer = 'NOT THE PR OWNER'
expect_any_instance_of(Octokit::Client).to receive(:add_comment)
.with(repo, id, ":eyes: @iamvery")
.with(repo, id, ":eyes: @#{expected_reviewer}")

send_command("add #{pr.user.login} to reviews")
send_command("add iamvery to reviews")
send_command("add #{expected_reviewer} to reviews")
send_command("review https://github.com/#{repo}/pull/#{id}")

expect(reply).to eq("iamvery should be on it...")
expect(reply).to eq("#{expected_reviewer} should be on it...")
end

it "handles errors gracefully" do
Expand Down

0 comments on commit d65838c

Please sign in to comment.