From c7827136cdbe62894671f3f9be38d22ddbc59c92 Mon Sep 17 00:00:00 2001 From: cyrillefr Date: Thu, 10 Apr 2025 15:54:46 +0200 Subject: [PATCH] Replace link with button in mailing options --- app/views/dashboard/mailing/_mailing_options.html.erb | 7 +++---- spec/system/dashboard/mailing_spec.rb | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/views/dashboard/mailing/_mailing_options.html.erb b/app/views/dashboard/mailing/_mailing_options.html.erb index fce44db6d..d3c00df4e 100644 --- a/app/views/dashboard/mailing/_mailing_options.html.erb +++ b/app/views/dashboard/mailing/_mailing_options.html.erb @@ -5,8 +5,7 @@ class: "button expanded" %> <% end %> - <%= link_to t("dashboard.mailing.mailing_options.send", address: current_user.email), - proposal_dashboard_mailing_index_path(proposal), - method: :post, - class: "button expanded" %> + <%= button_to t("dashboard.mailing.mailing_options.send", address: current_user.email), + proposal_dashboard_mailing_index_path(proposal), + class: "button expanded" %> diff --git a/spec/system/dashboard/mailing_spec.rb b/spec/system/dashboard/mailing_spec.rb index f890b8d60..a6125ecc7 100644 --- a/spec/system/dashboard/mailing_spec.rb +++ b/spec/system/dashboard/mailing_spec.rb @@ -13,11 +13,11 @@ describe "Mailing" do end scenario "Has a link to send the mail" do - expect(page).to have_link("Send to #{proposal.author.email}") + expect(page).to have_button("Send to #{proposal.author.email}") end scenario "User receives feedback after the email is sent" do - click_link "Send to #{proposal.author.email}" + click_button "Send to #{proposal.author.email}" expect(page).to have_content("The email has been sent") end @@ -31,6 +31,6 @@ describe "Mailing" do click_link "Preview" expect(page).not_to have_link("Preview") - expect(page).to have_link("Send to #{proposal.author.email}") + expect(page).to have_button("Send to #{proposal.author.email}") end end