Remove unnecessary author variables in specs
The factories creating proposals and debates automatically create an author.
This commit is contained in:
@@ -29,8 +29,7 @@ describe "Proposal Notifications" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario "Send a notification (Active voter)" do
|
scenario "Send a notification (Active voter)" do
|
||||||
author = create(:user)
|
proposal = create(:proposal)
|
||||||
proposal = create(:proposal, author: author)
|
|
||||||
|
|
||||||
voter = create(:user, :level_two)
|
voter = create(:user, :level_two)
|
||||||
create(:vote, voter: voter, votable: proposal)
|
create(:vote, voter: voter, votable: proposal)
|
||||||
@@ -41,8 +40,7 @@ describe "Proposal Notifications" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario "Send a notification (Follower)" do
|
scenario "Send a notification (Follower)" do
|
||||||
author = create(:user)
|
proposal = create(:proposal)
|
||||||
proposal = create(:proposal, author: author)
|
|
||||||
user_follower = create(:user)
|
user_follower = create(:user)
|
||||||
create(:follow, :followed_proposal, user: user_follower, followable: proposal)
|
create(:follow, :followed_proposal, user: user_follower, followable: proposal)
|
||||||
|
|
||||||
@@ -52,8 +50,7 @@ describe "Proposal Notifications" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario "Send a notification (Follower and Voter)" do
|
scenario "Send a notification (Follower and Voter)" do
|
||||||
author = create(:user)
|
proposal = create(:proposal)
|
||||||
proposal = create(:proposal, author: author)
|
|
||||||
|
|
||||||
user_voter_follower = create(:user)
|
user_voter_follower = create(:user)
|
||||||
create(:follow, :followed_proposal, user: user_voter_follower, followable: proposal)
|
create(:follow, :followed_proposal, user: user_voter_follower, followable: proposal)
|
||||||
@@ -68,8 +65,7 @@ describe "Proposal Notifications" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario "Send a notification (Blocked voter)" do
|
scenario "Send a notification (Blocked voter)" do
|
||||||
author = create(:user)
|
proposal = create(:proposal)
|
||||||
proposal = create(:proposal, author: author)
|
|
||||||
|
|
||||||
voter = create(:user, :level_two)
|
voter = create(:user, :level_two)
|
||||||
create(:vote, voter: voter, votable: proposal)
|
create(:vote, voter: voter, votable: proposal)
|
||||||
@@ -81,8 +77,7 @@ describe "Proposal Notifications" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario "Send a notification (Erased voter)" do
|
scenario "Send a notification (Erased voter)" do
|
||||||
author = create(:user)
|
proposal = create(:proposal)
|
||||||
proposal = create(:proposal, author: author)
|
|
||||||
|
|
||||||
voter = create(:user, :level_two)
|
voter = create(:user, :level_two)
|
||||||
create(:vote, voter: voter, votable: proposal)
|
create(:vote, voter: voter, votable: proposal)
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
require "rails_helper"
|
require "rails_helper"
|
||||||
|
|
||||||
describe ReplyEmail do
|
describe ReplyEmail do
|
||||||
|
let(:debate) { create(:debate) }
|
||||||
let(:author) { create(:user) }
|
|
||||||
let(:debate) { create(:debate, author: author) }
|
|
||||||
let(:commenter) { create(:user, email: "email@commenter.org") }
|
let(:commenter) { create(:user, email: "email@commenter.org") }
|
||||||
let(:comment) { create(:comment, commentable: debate, user: commenter) }
|
let(:comment) { create(:comment, commentable: debate, user: commenter) }
|
||||||
let(:replier) { create(:user) }
|
let(:replier) { create(:user) }
|
||||||
|
|||||||
Reference in New Issue
Block a user