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.
This commit is contained in:
Javi Martín
2024-10-11 03:13:56 +02:00
parent 2fb8abe83f
commit 58cba2316a
2 changed files with 2 additions and 2 deletions

View File

@@ -5,5 +5,5 @@
<%= t("management.users.erase_warning") %>
</div>
<%= 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") } %>
</div>

View File

@@ -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."