Replace link with button in Dashboard show
This commit is contained in:
@@ -13,8 +13,9 @@
|
||||
<% end %>
|
||||
|
||||
<% if can?(:publish, proposal) %>
|
||||
<%= link_to t("dashboard.index.publish"),
|
||||
<%= button_to t("dashboard.index.publish"),
|
||||
publish_proposal_dashboard_path(proposal),
|
||||
class: "button success",
|
||||
form_class: "button_to inline",
|
||||
method: :patch %>
|
||||
<% end %>
|
||||
|
||||
@@ -10,17 +10,17 @@ describe "Proposal's dashboard" do
|
||||
expect(page).to have_link("Edit my proposal")
|
||||
expect(page).to have_link("Edit 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("E-mail")
|
||||
expect(page).to have_link("Poster")
|
||||
end
|
||||
|
||||
scenario "Publish link dissapears after proposal's publication" do
|
||||
scenario "Publish button dissapears after proposal's publication" do
|
||||
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
|
||||
|
||||
scenario "Dashboard progress shows current goal" do
|
||||
|
||||
Reference in New Issue
Block a user