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" %> class: "button expanded" %>
<% end %> <% end %>
<%= link_to t("dashboard.mailing.mailing_options.send", address: current_user.email), <%= button_to t("dashboard.mailing.mailing_options.send", address: current_user.email),
proposal_dashboard_mailing_index_path(proposal), proposal_dashboard_mailing_index_path(proposal),
method: :post,
class: "button expanded" %> class: "button expanded" %>
</div> </div>

View File

@@ -13,11 +13,11 @@ describe "Mailing" do
end end
scenario "Has a link to send the mail" do 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 end
scenario "User receives feedback after the email is sent" do 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") expect(page).to have_content("The email has been sent")
end end
@@ -31,6 +31,6 @@ describe "Mailing" do
click_link "Preview" click_link "Preview"
expect(page).not_to have_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
end end