Ask for confirmation when hiding/blocking users
In the moderation section there's no clear indicator as to what the "Hide" and "Block" buttons do and the difference between them. Since we're using confirmation dialogs in all moderation actions except these ones, we're adding them here as well, so the difference will appear in the dialog. This isn't a very good solution, though, since the confirmation dialog comes after clicking the button and users have already been wondering whether clicking that button will be the right choice. A better solution would be making the purpose clear before the button is clicked, although that's something we don't do anywhere in the admin/moderation sections.
This commit is contained in:
@@ -24,7 +24,9 @@ describe "Moderate users" do
|
||||
visit debate_path(debate1)
|
||||
|
||||
within("#debate_#{debate1.id}") do
|
||||
accept_confirm("Are you sure? Block author \"#{debate1.author.name}\"") { click_button "Block author" }
|
||||
accept_confirm("Are you sure? This will hide the user \"#{debate1.author.name}\" and all their contents.") do
|
||||
click_button "Block author"
|
||||
end
|
||||
end
|
||||
|
||||
expect(page).to have_current_path(debates_path)
|
||||
@@ -64,7 +66,8 @@ describe "Moderate users" do
|
||||
within("#moderation_users") do
|
||||
expect(page).to have_content citizen.name
|
||||
expect(page).not_to have_content "Blocked"
|
||||
click_button "Block"
|
||||
|
||||
accept_confirm { click_button "Block" }
|
||||
end
|
||||
|
||||
within("#moderation_users") do
|
||||
|
||||
Reference in New Issue
Block a user