diff --git a/app/views/budgets/groups/show.html.erb b/app/views/budgets/groups/show.html.erb index 81a797797..aa1786f6b 100644 --- a/app/views/budgets/groups/show.html.erb +++ b/app/views/budgets/groups/show.html.erb @@ -5,7 +5,7 @@
- <%= back_link_to budgets_path %> + <%= back_link_to budget_path(@budget) %>

<%= t("budgets.groups.show.title") %>

diff --git a/app/views/budgets/investments/_header.html.erb b/app/views/budgets/investments/_header.html.erb index 0b18c3e1f..36fd6c02b 100644 --- a/app/views/budgets/investments/_header.html.erb +++ b/app/views/budgets/investments/_header.html.erb @@ -4,7 +4,7 @@
- <%= back_link_to budgets_path %> + <%= back_link_to budget_path(@budget) %> <% if can? :show, @ballot %> <%= link_to t("budgets.investments.header.check_ballot"), diff --git a/spec/system/budgets/groups_spec.rb b/spec/system/budgets/groups_spec.rb index df2eb6c8e..9b26bbd13 100644 --- a/spec/system/budgets/groups_spec.rb +++ b/spec/system/budgets/groups_spec.rb @@ -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 diff --git a/spec/system/budgets/investments_spec.rb b/spec/system/budgets/investments_spec.rb index 08cdad36f..65f463bd6 100644 --- a/spec/system/budgets/investments_spec.rb +++ b/spec/system/budgets/investments_spec.rb @@ -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