Replace link with button in Dashboard show

This commit is contained in:
cyrillefr
2025-04-11 08:34:13 +02:00
parent c7827136cd
commit 31ceb31256
2 changed files with 9 additions and 8 deletions

View File

@@ -13,8 +13,9 @@
<% end %> <% end %>
<% if can?(:publish, proposal) %> <% if can?(:publish, proposal) %>
<%= link_to t("dashboard.index.publish"), <%= button_to t("dashboard.index.publish"),
publish_proposal_dashboard_path(proposal), publish_proposal_dashboard_path(proposal),
class: "button success", class: "button success",
method: :patch %> form_class: "button_to inline",
method: :patch %>
<% end %> <% end %>

View File

@@ -10,17 +10,17 @@ describe "Proposal's dashboard" do
expect(page).to have_link("Edit my proposal") expect(page).to have_link("Edit my proposal")
expect(page).to have_link("Edit proposal") expect(page).to have_link("Edit proposal")
expect(page).to have_link("Withdraw proposal") expect(page).to have_link("Withdraw proposal")
expect(page).to have_link("Publish proposal") expect(page).to have_button("Publish proposal")
expect(page).to have_link("Polls") expect(page).to have_link("Polls")
expect(page).to have_link("E-mail") expect(page).to have_link("E-mail")
expect(page).to have_link("Poster") expect(page).to have_link("Poster")
end end
scenario "Publish link dissapears after proposal's publication" do scenario "Publish button dissapears after proposal's publication" do
visit proposal_dashboard_path(proposal) visit proposal_dashboard_path(proposal)
click_link "Publish proposal" click_button "Publish proposal"
expect(page).not_to have_link("Publish proposal") expect(page).not_to have_button("Publish proposal")
end end
scenario "Dashboard progress shows current goal" do scenario "Dashboard progress shows current goal" do