Use a more descriptive parameter name

This commit is contained in:
Javi Martín
2021-04-10 18:47:46 +02:00
parent 9db4fb593c
commit 2458ca22c5
2 changed files with 3 additions and 5 deletions

View File

@@ -6,13 +6,11 @@ module Comments
CommentNotifier.new(comment: comment).process
end
def reply_to(original_user, manuela = nil)
manuela ||= create(:user)
def reply_to(original_user, replier: create(:user))
debate = create(:debate)
comment = create(:comment, commentable: debate, user: original_user)
login_as(manuela)
login_as(replier)
visit debate_path(debate)
click_link "Reply"

View File

@@ -191,7 +191,7 @@ describe "Emails" do
end
scenario "Do not send email about own replies to own comments" do
reply_to(user, user)
reply_to(user, replier: user)
expect { open_last_email }.to raise_error("No email has been sent!")
end