Fix "go back" link in budget group and investments

Even if we usually only access these pages for the current budget, that
might not always be the case, and now that we've unified budget landing
pages, there's no point in them pointing to the index anymore.
This commit is contained in:
Javi Martín
2021-03-15 14:24:30 +01:00
parent 05e3584430
commit 135e154fe3
4 changed files with 14 additions and 2 deletions

View File

@@ -5,7 +5,7 @@
<div class="budget-header">
<div class="row">
<div class="small-12 medium-9 column">
<%= back_link_to budgets_path %>
<%= back_link_to budget_path(@budget) %>
<h2><%= t("budgets.groups.show.title") %></h2>
</div>
</div>

View File

@@ -4,7 +4,7 @@
<div class="row">
<div class="small-12 column">
<%= back_link_to budgets_path %>
<%= back_link_to budget_path(@budget) %>
<% if can? :show, @ballot %>
<%= link_to t("budgets.investments.header.check_ballot"),

View File

@@ -68,5 +68,13 @@ describe "Budget Groups" do
expect(page).to have_link "Southwest"
expect(page).not_to have_link "See investments not selected for balloting phase unfeasible investments"
end
scenario "Back link", :js do
visit budget_group_path(budget, group)
click_link "Go back"
expect(page).to have_current_path budget_path(budget)
end
end
end

View File

@@ -88,6 +88,10 @@ describe "Budget Investments" do
expect(page).not_to have_content(unfeasible_investment.title)
end
end
click_link "Go back"
expect(page).to have_current_path budget_path(budget)
end
scenario "Index view mode" do