Merge pull request #5927 from cyrillefr/ReplaceLinkWithButtonInInvestmentComponent
Replace link with button in ballot investment component
This commit is contained in:
@@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
.remove-budget-investment {
|
.remove-budget-investment {
|
||||||
@include has-fa-icon(times, solid);
|
@include has-fa-icon(times, solid);
|
||||||
|
cursor: pointer;
|
||||||
font-size: $close-icon-size;
|
font-size: $close-icon-size;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: $close-icon-margin;
|
right: $close-icon-margin;
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
<%= investment_price %>
|
<%= investment_price %>
|
||||||
|
|
||||||
<% if budget.balloting? %>
|
<% if budget.balloting? %>
|
||||||
<%= link_to delete_path,
|
<%= button_to delete_path,
|
||||||
title: t("budgets.ballots.show.remove"),
|
title: t("budgets.ballots.show.remove"),
|
||||||
class: "remove-budget-investment",
|
class: "remove-budget-investment",
|
||||||
method: :delete,
|
method: :delete,
|
||||||
remote: true do %>
|
remote: true do %>
|
||||||
<span class="show-for-sr"><%= t("budgets.ballots.show.remove") %></span>
|
<span class="show-for-sr"><%= t("budgets.ballots.show.remove") %></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -379,7 +379,7 @@ describe "Ballots" do
|
|||||||
expect(page).to have_content("You have voted one investment")
|
expect(page).to have_content("You have voted one investment")
|
||||||
|
|
||||||
within("#budget_investment_#{investment.id}") do
|
within("#budget_investment_#{investment.id}") do
|
||||||
click_link "Remove vote"
|
click_button "Remove vote"
|
||||||
end
|
end
|
||||||
|
|
||||||
expect(page).to have_current_path(budget_ballot_path(budget))
|
expect(page).to have_current_path(budget_ballot_path(budget))
|
||||||
@@ -406,7 +406,7 @@ describe "Ballots" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
within("#sidebar #budget_investment_#{investment1.id}_sidebar") do
|
within("#sidebar #budget_investment_#{investment1.id}_sidebar") do
|
||||||
click_link "Remove vote"
|
click_button "Remove vote"
|
||||||
end
|
end
|
||||||
|
|
||||||
expect(page).to have_css("#total_amount", text: "€20,000")
|
expect(page).to have_css("#total_amount", text: "€20,000")
|
||||||
@@ -436,7 +436,7 @@ describe "Ballots" do
|
|||||||
expect(page).to have_content("You have voted one investment")
|
expect(page).to have_content("You have voted one investment")
|
||||||
|
|
||||||
within(".ballot-list li", text: "Sully monument") do
|
within(".ballot-list li", text: "Sully monument") do
|
||||||
click_link "Remove vote"
|
click_button "Remove vote"
|
||||||
end
|
end
|
||||||
|
|
||||||
expect(page).to have_content("You have voted 0 investments")
|
expect(page).to have_content("You have voted 0 investments")
|
||||||
@@ -623,7 +623,7 @@ describe "Ballots" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
within("#budget_investment_#{bi1.id}_sidebar") do
|
within("#budget_investment_#{bi1.id}_sidebar") do
|
||||||
click_link "Remove vote"
|
click_button "Remove vote"
|
||||||
end
|
end
|
||||||
|
|
||||||
expect(page).not_to have_css "#budget_investment_#{bi1.id}_sidebar"
|
expect(page).not_to have_css "#budget_investment_#{bi1.id}_sidebar"
|
||||||
|
|||||||
Reference in New Issue
Block a user