Replace link with button in mailing options

This commit is contained in:
cyrillefr
2025-04-10 15:54:46 +02:00
parent 30979b2e96
commit c7827136cd
2 changed files with 6 additions and 7 deletions

View File

@@ -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" %>
</div>

View File

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