diff --git a/spec/system/admin/activity_spec.rb b/spec/system/admin/activity_spec.rb index af1e3ffdd..e92270c2b 100644 --- a/spec/system/admin/activity_spec.rb +++ b/spec/system/admin/activity_spec.rb @@ -212,12 +212,12 @@ describe "Admin activity" do context "User" do scenario "Shows moderation activity on users" do - proposal = create(:proposal) + proposal = create(:proposal, author: create(:user, username: "Sam")) visit proposal_path(proposal) within("#proposal_#{proposal.id}") do - accept_confirm("Are you sure? This will hide the user \"#{proposal.author.name}\" and all their contents.") do + accept_confirm("Are you sure? This will hide the user \"Sam\" and all their contents.") do click_button "Block author" end diff --git a/spec/system/admin/hidden_comments_spec.rb b/spec/system/admin/hidden_comments_spec.rb index 36902e4d8..7f86f1bf1 100644 --- a/spec/system/admin/hidden_comments_spec.rb +++ b/spec/system/admin/hidden_comments_spec.rb @@ -2,7 +2,7 @@ require "rails_helper" describe "Admin hidden comments", :admin do scenario "Do not show comments from blocked users" do - comment = create(:comment, :hidden, body: "SPAM from SPAMMER") + comment = create(:comment, :hidden, body: "SPAM from SPAMMER", author: create(:user, username: "Evil")) proposal = create(:proposal, author: comment.author) create(:comment, commentable: proposal, user: comment.author, body: "Good Proposal!") @@ -13,7 +13,7 @@ describe "Admin hidden comments", :admin do visit proposal_path(proposal) within("#proposal_#{proposal.id}") do - accept_confirm("Are you sure? This will hide the user \"#{proposal.author.name}\" and all their contents.") do + accept_confirm("Are you sure? This will hide the user \"Evil\" and all their contents.") do click_button "Block author" end end diff --git a/spec/system/moderation/budget_investments_spec.rb b/spec/system/moderation/budget_investments_spec.rb index bf8ec87d1..d4d7aa0e1 100644 --- a/spec/system/moderation/budget_investments_spec.rb +++ b/spec/system/moderation/budget_investments_spec.rb @@ -4,7 +4,8 @@ describe "Moderate budget investments" do let(:budget) { create(:budget) } let(:heading) { create(:budget_heading, budget: budget, price: 666666) } let(:mod) { create(:moderator) } - let!(:investment) { create(:budget_investment, heading: heading, author: create(:user)) } + let(:author) { create(:user, username: "Julia") } + let!(:investment) { create(:budget_investment, heading: heading, author: author) } scenario "Hiding an investment" do login_as(mod.user) @@ -23,7 +24,7 @@ describe "Moderate budget investments" do login_as(mod.user) visit budget_investment_path(budget, investment) - accept_confirm("Are you sure? This will hide the user \"#{investment.author.name}\" and all their contents.") do + accept_confirm("Are you sure? This will hide the user \"Julia\" and all their contents.") do click_button "Block author" end diff --git a/spec/system/moderation/users_spec.rb b/spec/system/moderation/users_spec.rb index ce9eed9ec..7ea01a603 100644 --- a/spec/system/moderation/users_spec.rb +++ b/spec/system/moderation/users_spec.rb @@ -2,7 +2,7 @@ require "rails_helper" describe "Moderate users" do scenario "Hide" do - citizen = create(:user) + citizen = create(:user, username: "Mike") moderator = create(:moderator) debate1 = create(:debate, author: citizen) @@ -24,7 +24,7 @@ describe "Moderate users" do visit debate_path(debate1) within("#debate_#{debate1.id}") do - accept_confirm("Are you sure? This will hide the user \"#{debate1.author.name}\" and all their contents.") do + accept_confirm("Are you sure? This will hide the user \"Mike\" and all their contents.") do click_button "Block author" end end