From 2458ca22c550fb9e1aaae47b04a67eea9aef0833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 10 Apr 2021 18:47:46 +0200 Subject: [PATCH] Use a more descriptive parameter name --- spec/support/common_actions/comments.rb | 6 ++---- spec/system/emails_spec.rb | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/spec/support/common_actions/comments.rb b/spec/support/common_actions/comments.rb index a53c17cd9..008bf8ce6 100644 --- a/spec/support/common_actions/comments.rb +++ b/spec/support/common_actions/comments.rb @@ -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" diff --git a/spec/system/emails_spec.rb b/spec/system/emails_spec.rb index dd40390c5..d24776c5a 100644 --- a/spec/system/emails_spec.rb +++ b/spec/system/emails_spec.rb @@ -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