Add Milestone tag select filter on executions public page

This commit is contained in:
lalo
2019-04-03 09:51:13 +02:00
parent 63e0cd02d0
commit be8a0dbe8a
28 changed files with 180 additions and 38 deletions

View File

@@ -1335,6 +1335,7 @@ describe "Admin budget investments" do
budget_investment = create(:budget_investment)
visit admin_budget_budget_investment_path(budget_investment.budget, budget_investment)
expect(page).not_to have_content("Milestone Tags:")
click_link "Edit classification"

View File

@@ -235,6 +235,52 @@ describe "Executions" do
select "Bidding (0)", from: "status"
expect(page).not_to have_content(investment1.title)
end
scenario "by milestone tag, only display tags for winner investments", :js do
create(:milestone, milestoneable: investment1, status: status1)
create(:milestone, milestoneable: investment2, status: status2)
create(:milestone, milestoneable: investment3, status: status2)
investment1.milestone_tag_list.add("tag1", "tag2")
investment1.save
investment2.milestone_tag_list.add("tag2")
investment2.save
investment3.milestone_tag_list.add("tag2")
investment3.save
visit budget_path(budget)
click_link "See results"
click_link "Milestones"
expect(page).to have_content(investment1.title)
expect(page).to have_content(investment2.title)
select "tag2 (2)", from: "milestone_tag"
expect(page).to have_content(investment1.title)
expect(page).to have_content(investment2.title)
select "Studying the project (1)", from: "status"
expect(page).to have_content(investment1.title)
expect(page).not_to have_content(investment2.title)
select "Bidding (1)", from: "status"
expect(page).not_to have_content(investment1.title)
expect(page).to have_content(investment2.title)
select "tag1 (1)", from: "milestone_tag"
expect(page).not_to have_content(investment1.title)
expect(page).not_to have_content(investment2.title)
select "All (2)", from: "milestone_tag"
expect(page).not_to have_content(investment1.title)
expect(page).to have_content(investment2.title)
end
end
context "Heading Order" do