Fix group investments filters links

They were pointing to the budget page instead of the budget group page,
which made navigation weird.
This commit is contained in:
Javi Martín
2021-03-15 14:16:25 +01:00
parent 12da0f5293
commit f5c1cfbf8c
3 changed files with 21 additions and 5 deletions

View File

@@ -55,7 +55,7 @@
<div class="small-12 column">
<small>
<%= link_to t("budgets.groups.show.unfeasible"),
budget_path(@budget, filter: "unfeasible") %>
budget_group_path(@budget, @group, filter: "unfeasible") %>
</small>
</div>
</div>
@@ -66,7 +66,7 @@
<div class="small-12 column">
<small>
<%= link_to t("budgets.groups.show.unselected"),
budget_path(@budget, filter: "unselected") %>
budget_group_path(@budget, @group, filter: "unselected") %>
</small>
</div>
</div>

View File

@@ -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

View File

@@ -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}")