From 7db32b337b0b9e6a2800aa9533c58d7244d62b4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Mon, 23 Sep 2019 18:25:08 +0200 Subject: [PATCH] Remove unnecessary author variables in specs The factories creating proposals and debates automatically create an author. --- spec/features/proposal_notifications_spec.rb | 15 +++++---------- spec/lib/reply_email_spec.rb | 4 +--- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/spec/features/proposal_notifications_spec.rb b/spec/features/proposal_notifications_spec.rb index 55230ba25..cbf542f58 100644 --- a/spec/features/proposal_notifications_spec.rb +++ b/spec/features/proposal_notifications_spec.rb @@ -29,8 +29,7 @@ describe "Proposal Notifications" do end scenario "Send a notification (Active voter)" do - author = create(:user) - proposal = create(:proposal, author: author) + proposal = create(:proposal) voter = create(:user, :level_two) create(:vote, voter: voter, votable: proposal) @@ -41,8 +40,7 @@ describe "Proposal Notifications" do end scenario "Send a notification (Follower)" do - author = create(:user) - proposal = create(:proposal, author: author) + proposal = create(:proposal) user_follower = create(:user) create(:follow, :followed_proposal, user: user_follower, followable: proposal) @@ -52,8 +50,7 @@ describe "Proposal Notifications" do end scenario "Send a notification (Follower and Voter)" do - author = create(:user) - proposal = create(:proposal, author: author) + proposal = create(:proposal) user_voter_follower = create(:user) create(:follow, :followed_proposal, user: user_voter_follower, followable: proposal) @@ -68,8 +65,7 @@ describe "Proposal Notifications" do end scenario "Send a notification (Blocked voter)" do - author = create(:user) - proposal = create(:proposal, author: author) + proposal = create(:proposal) voter = create(:user, :level_two) create(:vote, voter: voter, votable: proposal) @@ -81,8 +77,7 @@ describe "Proposal Notifications" do end scenario "Send a notification (Erased voter)" do - author = create(:user) - proposal = create(:proposal, author: author) + proposal = create(:proposal) voter = create(:user, :level_two) create(:vote, voter: voter, votable: proposal) diff --git a/spec/lib/reply_email_spec.rb b/spec/lib/reply_email_spec.rb index 87819e3d1..68054e08f 100644 --- a/spec/lib/reply_email_spec.rb +++ b/spec/lib/reply_email_spec.rb @@ -1,9 +1,7 @@ require "rails_helper" describe ReplyEmail do - - let(:author) { create(:user) } - let(:debate) { create(:debate, author: author) } + let(:debate) { create(:debate) } let(:commenter) { create(:user, email: "email@commenter.org") } let(:comment) { create(:comment, commentable: debate, user: commenter) } let(:replier) { create(:user) }