diff --git a/app/components/admin/site_customization/pages/edit_component.html.erb b/app/components/admin/site_customization/pages/edit_component.html.erb index 6e7650ad3..9b4850cec 100644 --- a/app/components/admin/site_customization/pages/edit_component.html.erb +++ b/app/components/admin/site_customization/pages/edit_component.html.erb @@ -7,6 +7,7 @@ @page, text: t("admin.site_customization.pages.index.delete"), method: :delete, + confirm: true, class: "delete" ) %> <% end %> diff --git a/spec/system/admin/site_customization/pages_spec.rb b/spec/system/admin/site_customization/pages_spec.rb index 6d1f5d841..6192d5632 100644 --- a/spec/system/admin/site_customization/pages_spec.rb +++ b/spec/system/admin/site_customization/pages_spec.rb @@ -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"