mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 10:32:08 +08:00
FEATURE: Add an option to block IPs and emails to bulk user delete (#29993)
This commit adds an option for blocking the IP and email addresses when bulk-deleting users. Internal topic: t/140321/11.
This commit is contained in:
@ -143,6 +143,35 @@ describe "Admin Users Page", type: :system do
|
||||
confirmation_modal.close
|
||||
expect(admin_users_page).to have_users([user_1.id])
|
||||
end
|
||||
|
||||
it "has an option to block IPs and emails" do
|
||||
user_1.update!(ip_address: IPAddr.new("44.22.11.33"))
|
||||
|
||||
admin_users_page.visit
|
||||
admin_users_page.bulk_select_button.click
|
||||
|
||||
admin_users_page.user_row(user_1.id).bulk_select_checkbox.click
|
||||
admin_users_page.bulk_actions_dropdown.expand
|
||||
admin_users_page.bulk_actions_dropdown.option(".bulk-delete").click
|
||||
confirmation_modal.fill_in_confirmation_phase(user_count: 1)
|
||||
confirmation_modal.block_ip_and_email_checkbox.click
|
||||
confirmation_modal.confirm_button.click
|
||||
|
||||
expect(confirmation_modal).to have_successful_log_entry_for_user(
|
||||
user: user_1,
|
||||
position: 1,
|
||||
total: 1,
|
||||
)
|
||||
expect(
|
||||
ScreenedIpAddress.exists?(
|
||||
ip_address: user_1.ip_address,
|
||||
action_type: ScreenedIpAddress.actions[:block],
|
||||
),
|
||||
).to be_truthy
|
||||
expect(
|
||||
ScreenedEmail.exists?(email: user_1.email, action_type: ScreenedEmail.actions[:block]),
|
||||
).to be_truthy
|
||||
end
|
||||
end
|
||||
|
||||
context "when visiting an admin's page" do
|
||||
|
Reference in New Issue
Block a user