Make moderation tests easier to read
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user