Merge pull request #3376 from LextrendIT/3350_rename_debates_comments_admin
Refactor admin/debates and admin/comments to hidden
This commit is contained in:
@@ -117,7 +117,7 @@ describe "Admin activity" do
|
||||
scenario "Shows admin restores" do
|
||||
debate = create(:debate, :hidden)
|
||||
|
||||
visit admin_debates_path
|
||||
visit admin_hidden_debates_path
|
||||
|
||||
within("#debate_#{debate.id}") do
|
||||
click_on "Restore"
|
||||
@@ -181,7 +181,7 @@ describe "Admin activity" do
|
||||
scenario "Shows admin restores" do
|
||||
comment = create(:comment, :hidden)
|
||||
|
||||
visit admin_comments_path
|
||||
visit admin_hidden_comments_path
|
||||
|
||||
within("#comment_#{comment.id}") do
|
||||
click_on "Restore"
|
||||
|
||||
@@ -12,7 +12,7 @@ describe "Admin comments" do
|
||||
proposal = create(:proposal, author: comment.author)
|
||||
create(:comment, commentable: proposal, user: comment.author, body: "Good Proposal!")
|
||||
|
||||
visit admin_comments_path
|
||||
visit admin_hidden_comments_path
|
||||
expect(page).to have_content("SPAM from SPAMMER")
|
||||
expect(page).not_to have_content("Good Proposal!")
|
||||
|
||||
@@ -21,7 +21,7 @@ describe "Admin comments" do
|
||||
click_link "Hide author"
|
||||
end
|
||||
|
||||
visit admin_comments_path
|
||||
visit admin_hidden_comments_path
|
||||
expect(page).not_to have_content("SPAM from SPAMMER")
|
||||
expect(page).not_to have_content("Good Proposal!")
|
||||
end
|
||||
@@ -32,7 +32,7 @@ describe "Admin comments" do
|
||||
create(:comment, :hidden, commentable: debate, body: "This is SPAM comment on debate")
|
||||
create(:comment, :hidden, commentable: proposal, body: "This is SPAM comment on proposal")
|
||||
|
||||
visit admin_comments_path
|
||||
visit admin_hidden_comments_path
|
||||
|
||||
expect(page).to have_content("Debate with spam comment")
|
||||
expect(page).to have_content("Proposal with spam comment")
|
||||
@@ -43,7 +43,7 @@ describe "Admin comments" do
|
||||
expect(page).to have_content("Debate with spam comment")
|
||||
expect(page).not_to have_content("This is SPAM comment on debate")
|
||||
|
||||
visit admin_comments_path
|
||||
visit admin_hidden_comments_path
|
||||
|
||||
click_link "Proposal with spam comment"
|
||||
expect(page).to have_content("Proposal with spam comment")
|
||||
@@ -56,7 +56,7 @@ describe "Admin comments" do
|
||||
create(:comment, :hidden, commentable: debate, body: "This is SPAM comment on debate")
|
||||
create(:comment, :hidden, commentable: proposal, body: "This is SPAM comment on proposal")
|
||||
|
||||
visit admin_comments_path
|
||||
visit admin_hidden_comments_path
|
||||
|
||||
expect(page).to have_content("(Hidden proposal: Hidden proposal title)")
|
||||
expect(page).to have_content("(Hidden debate: Hidden debate title)")
|
||||
@@ -67,7 +67,7 @@ describe "Admin comments" do
|
||||
|
||||
scenario "Restore" do
|
||||
comment = create(:comment, :hidden, body: "Not really SPAM")
|
||||
visit admin_comments_path
|
||||
visit admin_hidden_comments_path
|
||||
|
||||
click_link "Restore"
|
||||
|
||||
@@ -79,7 +79,7 @@ describe "Admin comments" do
|
||||
|
||||
scenario "Confirm hide" do
|
||||
comment = create(:comment, :hidden, body: "SPAM")
|
||||
visit admin_comments_path
|
||||
visit admin_hidden_comments_path
|
||||
|
||||
click_link "Confirm moderation"
|
||||
|
||||
@@ -91,22 +91,22 @@ describe "Admin comments" do
|
||||
end
|
||||
|
||||
scenario "Current filter is properly highlighted" do
|
||||
visit admin_comments_path
|
||||
visit admin_hidden_comments_path
|
||||
expect(page).not_to have_link("Pending")
|
||||
expect(page).to have_link("All")
|
||||
expect(page).to have_link("Confirmed")
|
||||
|
||||
visit admin_comments_path(filter: "Pending")
|
||||
visit admin_hidden_comments_path(filter: "Pending")
|
||||
expect(page).not_to have_link("Pending")
|
||||
expect(page).to have_link("All")
|
||||
expect(page).to have_link("Confirmed")
|
||||
|
||||
visit admin_comments_path(filter: "all")
|
||||
visit admin_hidden_comments_path(filter: "all")
|
||||
expect(page).to have_link("Pending")
|
||||
expect(page).not_to have_link("All")
|
||||
expect(page).to have_link("Confirmed")
|
||||
|
||||
visit admin_comments_path(filter: "with_confirmed_hide")
|
||||
visit admin_hidden_comments_path(filter: "with_confirmed_hide")
|
||||
expect(page).to have_link("Pending")
|
||||
expect(page).to have_link("All")
|
||||
expect(page).not_to have_link("Confirmed")
|
||||
@@ -116,11 +116,11 @@ describe "Admin comments" do
|
||||
create(:comment, :hidden, body: "Unconfirmed comment")
|
||||
create(:comment, :hidden, :with_confirmed_hide, body: "Confirmed comment")
|
||||
|
||||
visit admin_comments_path(filter: "all")
|
||||
visit admin_hidden_comments_path(filter: "all")
|
||||
expect(page).to have_content("Unconfirmed comment")
|
||||
expect(page).to have_content("Confirmed comment")
|
||||
|
||||
visit admin_comments_path(filter: "with_confirmed_hide")
|
||||
visit admin_hidden_comments_path(filter: "with_confirmed_hide")
|
||||
expect(page).not_to have_content("Unconfirmed comment")
|
||||
expect(page).to have_content("Confirmed comment")
|
||||
end
|
||||
@@ -129,7 +129,7 @@ describe "Admin comments" do
|
||||
per_page = Kaminari.config.default_per_page
|
||||
(per_page + 2).times { create(:comment, :hidden, :with_confirmed_hide) }
|
||||
|
||||
visit admin_comments_path(filter: "with_confirmed_hide", page: 2)
|
||||
visit admin_hidden_comments_path(filter: "with_confirmed_hide", page: 2)
|
||||
|
||||
click_on("Restore", match: :first, exact: true)
|
||||
|
||||
@@ -137,4 +137,4 @@ describe "Admin comments" do
|
||||
expect(current_url).to include("page=2")
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,7 +7,7 @@ describe "Admin debates" do
|
||||
admin = create(:administrator)
|
||||
login_as(admin.user)
|
||||
|
||||
expect{ visit admin_debates_path }.to raise_exception(FeatureFlags::FeatureDisabled)
|
||||
expect{ visit admin_hidden_debates_path }.to raise_exception(FeatureFlags::FeatureDisabled)
|
||||
|
||||
Setting["process.debates"] = true
|
||||
end
|
||||
@@ -19,7 +19,7 @@ describe "Admin debates" do
|
||||
|
||||
scenario "Restore" do
|
||||
debate = create(:debate, :hidden)
|
||||
visit admin_debates_path
|
||||
visit admin_hidden_debates_path
|
||||
|
||||
click_link "Restore"
|
||||
|
||||
@@ -31,7 +31,7 @@ describe "Admin debates" do
|
||||
|
||||
scenario "Confirm hide" do
|
||||
debate = create(:debate, :hidden)
|
||||
visit admin_debates_path
|
||||
visit admin_hidden_debates_path
|
||||
|
||||
click_link "Confirm moderation"
|
||||
|
||||
@@ -43,22 +43,22 @@ describe "Admin debates" do
|
||||
end
|
||||
|
||||
scenario "Current filter is properly highlighted" do
|
||||
visit admin_debates_path
|
||||
visit admin_hidden_debates_path
|
||||
expect(page).not_to have_link("Pending")
|
||||
expect(page).to have_link("All")
|
||||
expect(page).to have_link("Confirmed")
|
||||
|
||||
visit admin_debates_path(filter: "Pending")
|
||||
visit admin_hidden_debates_path(filter: "Pending")
|
||||
expect(page).not_to have_link("Pending")
|
||||
expect(page).to have_link("All")
|
||||
expect(page).to have_link("Confirmed")
|
||||
|
||||
visit admin_debates_path(filter: "all")
|
||||
visit admin_hidden_debates_path(filter: "all")
|
||||
expect(page).to have_link("Pending")
|
||||
expect(page).not_to have_link("All")
|
||||
expect(page).to have_link("Confirmed")
|
||||
|
||||
visit admin_debates_path(filter: "with_confirmed_hide")
|
||||
visit admin_hidden_debates_path(filter: "with_confirmed_hide")
|
||||
expect(page).to have_link("All")
|
||||
expect(page).to have_link("Pending")
|
||||
expect(page).not_to have_link("Confirmed")
|
||||
@@ -68,15 +68,15 @@ describe "Admin debates" do
|
||||
create(:debate, :hidden, title: "Unconfirmed debate")
|
||||
create(:debate, :hidden, :with_confirmed_hide, title: "Confirmed debate")
|
||||
|
||||
visit admin_debates_path(filter: "pending")
|
||||
visit admin_hidden_debates_path(filter: "pending")
|
||||
expect(page).to have_content("Unconfirmed debate")
|
||||
expect(page).not_to have_content("Confirmed debate")
|
||||
|
||||
visit admin_debates_path(filter: "all")
|
||||
visit admin_hidden_debates_path(filter: "all")
|
||||
expect(page).to have_content("Unconfirmed debate")
|
||||
expect(page).to have_content("Confirmed debate")
|
||||
|
||||
visit admin_debates_path(filter: "with_confirmed_hide")
|
||||
visit admin_hidden_debates_path(filter: "with_confirmed_hide")
|
||||
expect(page).not_to have_content("Unconfirmed debate")
|
||||
expect(page).to have_content("Confirmed debate")
|
||||
end
|
||||
@@ -85,7 +85,7 @@ describe "Admin debates" do
|
||||
per_page = Kaminari.config.default_per_page
|
||||
(per_page + 2).times { create(:debate, :hidden, :with_confirmed_hide) }
|
||||
|
||||
visit admin_debates_path(filter: "with_confirmed_hide", page: 2)
|
||||
visit admin_hidden_debates_path(filter: "with_confirmed_hide", page: 2)
|
||||
|
||||
click_on("Restore", match: :first, exact: true)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user