From 58cba2316aedb3efefe32a6b41c10fdce7d78f7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 11 Oct 2024 03:13:56 +0200 Subject: [PATCH] Use a button to erase an account in the management area As mentioned in commit 5311daadf, there are several reasons to use buttons in these situations. And, as mentioned in the previous commit, using buttons instead of links for actions requiring confirmation will help us test for accessibility issues. --- app/views/management/users/_erase_user_account.html.erb | 2 +- spec/system/management/users_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/management/users/_erase_user_account.html.erb b/app/views/management/users/_erase_user_account.html.erb index 5746e103a..f7089203a 100644 --- a/app/views/management/users/_erase_user_account.html.erb +++ b/app/views/management/users/_erase_user_account.html.erb @@ -5,5 +5,5 @@ <%= t("management.users.erase_warning") %> - <%= link_to t("management.users.erase_submit"), erase_management_users_path, method: :delete, class: "button hollow alert", data: { confirm: t("management.users.erase_account_confirm") } %> + <%= button_to t("management.users.erase_submit"), erase_management_users_path, method: :delete, class: "button hollow alert", data: { confirm: t("management.users.erase_account_confirm") } %> diff --git a/spec/system/management/users_spec.rb b/spec/system/management/users_spec.rb index 2291e9f56..fccf14b29 100644 --- a/spec/system/management/users_spec.rb +++ b/spec/system/management/users_spec.rb @@ -82,7 +82,7 @@ describe "Users" do expect(page).to have_content "This user can participate in the website with the following permissions" click_link "Delete user" - accept_confirm { click_link "Delete account" } + accept_confirm { click_button "Delete account" } expect(page).to have_content "User account deleted."