Skip to content

Commit

Permalink
Rename remaining method calls to add_reviewer
Browse files Browse the repository at this point in the history
  • Loading branch information
bdunne committed Mar 1, 2018
1 parent 665cb69 commit 01b7dd0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/github_service/commands/add_reviewer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def _execute(issuer:, value:)
user = value.strip.delete('@')

if valid_assignee?(user)
issue.review(user)
issue.add_reviewer(user)
else
issue.add_comment("@#{issuer} '#{user}' is an invalid reviewer, ignoring...")
end
Expand Down
2 changes: 1 addition & 1 deletion lib/github_service/issue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def assign(user)
GithubService.update_issue(fq_repo_name, number, "assignee" => user)
end

def review(user)
def add_reviewer(user)
GithubService.request_pull_request_review(fq_repo_name, number, [user]) if pull_request?
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
let(:command_value) { "good_user" }

it "review request that user" do
expect(issue).to receive(:review).with("good_user")
expect(issue).to receive(:add_reviewer).with("good_user")
end
end

context "with an invalid user" do
let(:command_value) { "bad_user" }

it "does not review request, reports failure" do
expect(issue).not_to receive(:assign)
expect(issue).not_to receive(:add_reviewer)
expect(issue).to receive(:add_comment).with("@#{command_issuer} 'bad_user' is an invalid reviewer, ignoring...")
end
end
Expand Down

0 comments on commit 01b7dd0

Please sign in to comment.