Ask confirmation to delete pages from the edit page
We were already doing that when deleting pages from the index page, and we also ask for confirmation in almost every page in the admin section.
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
@page,
|
||||
text: t("admin.site_customization.pages.index.delete"),
|
||||
method: :delete,
|
||||
confirm: true,
|
||||
class: "delete"
|
||||
) %>
|
||||
<% end %>
|
||||
|
||||
@@ -93,7 +93,9 @@ describe "Admin custom pages", :admin do
|
||||
custom_page = create(:site_customization_page, title: "An example custom page")
|
||||
visit edit_admin_site_customization_page_path(custom_page)
|
||||
|
||||
click_button "Delete page"
|
||||
accept_confirm "Are you sure? This action will delete \"An example custom page\" and can't be undone." do
|
||||
click_button "Delete page"
|
||||
end
|
||||
|
||||
expect(page).not_to have_content "An example custom page"
|
||||
expect(page).not_to have_content "example-page"
|
||||
|
||||
Reference in New Issue
Block a user