diff --git a/app/views/budgets/groups/show.html.erb b/app/views/budgets/groups/show.html.erb
index b7565a265..d8741f6eb 100644
--- a/app/views/budgets/groups/show.html.erb
+++ b/app/views/budgets/groups/show.html.erb
@@ -55,7 +55,7 @@
<%= link_to t("budgets.groups.show.unfeasible"),
- budget_path(@budget, filter: "unfeasible") %>
+ budget_group_path(@budget, @group, filter: "unfeasible") %>
@@ -66,7 +66,7 @@
<%= link_to t("budgets.groups.show.unselected"),
- budget_path(@budget, filter: "unselected") %>
+ budget_group_path(@budget, @group, filter: "unselected") %>
diff --git a/spec/system/budgets/groups_spec.rb b/spec/system/budgets/groups_spec.rb
index c8f68b0d8..df2eb6c8e 100644
--- a/spec/system/budgets/groups_spec.rb
+++ b/spec/system/budgets/groups_spec.rb
@@ -49,5 +49,24 @@ describe "Budget Groups" do
expect(first_heading.name).to appear_before(last_heading.name)
end
+
+ scenario "Links to investment filters", :js do
+ create(:budget_heading, group: group, name: "Southwest")
+ budget.update!(phase: "finished")
+
+ visit budget_group_path(budget, group)
+
+ click_link "See unfeasible investments"
+
+ expect(page).to have_css "h3", exact_text: "Unfeasible investments"
+ expect(page).to have_link "Southwest"
+ expect(page).not_to have_link "See unfeasible investments"
+
+ click_link "See investments not selected for balloting phase"
+
+ expect(page).to have_css "h3", exact_text: "Investments not selected for balloting phase"
+ expect(page).to have_link "Southwest"
+ expect(page).not_to have_link "See investments not selected for balloting phase unfeasible investments"
+ end
end
end
diff --git a/spec/system/budgets/investments_spec.rb b/spec/system/budgets/investments_spec.rb
index 11a7707fd..73555d56a 100644
--- a/spec/system/budgets/investments_spec.rb
+++ b/spec/system/budgets/investments_spec.rb
@@ -1325,10 +1325,7 @@ describe "Budget Investments" do
expect(page).to have_css("#budget_heading_#{heading_1.id}.is-active")
expect(page).to have_css("#budget_heading_#{heading_2.id}")
- visit budget_group_path(budget, group)
-
click_link "See unfeasible investments"
- click_link "Health"
within("#headings") do
expect(page).to have_css("#budget_heading_#{heading_1.id}")