Consider having valuator group as having valuator

So under the tab "without valuator" we don't show investments assigned
to a valuator group, just as expected by administrators.

There was a conflict while applying this commit to the CONSUL repo. I've
decided to re-introduce the test which was deleted in commit dddf026a,
which hadn't been deleted in AyuntamientoMadrid@192f1182.
This commit is contained in:
Javi Martín
2019-01-09 13:30:34 +01:00
parent b330de01f6
commit bd67fcb9cf
2 changed files with 16 additions and 4 deletions

View File

@@ -270,19 +270,30 @@ feature 'Admin budget investments' do
end
scenario "Filtering by assignment status" do
assigned = create(:budget_investment, title: "Assigned idea", budget: budget, administrator: create(:administrator))
valuating = create(:budget_investment, title: "Evaluating...", budget: budget)
valuating.valuators.push(create(:valuator))
create(:budget_investment, title: "Assigned idea", budget: budget,
administrator: create(:administrator))
create(:budget_investment, title: "Evaluating...", budget: budget,
valuators: [create(:valuator)])
create(:budget_investment, title: "With group", budget: budget,
valuator_groups: [create(:valuator_group)])
visit admin_budget_budget_investments_path(budget_id: budget.id, filter: "valuation_open")
expect(page).to have_content("Assigned idea")
expect(page).to have_content("Evaluating...")
expect(page).to have_content("With group")
visit admin_budget_budget_investments_path(budget_id: budget.id, filter: 'without_admin')
expect(page).to have_content("Evaluating...")
expect(page).to have_content("With group")
expect(page).not_to have_content("Assigned idea")
visit admin_budget_budget_investments_path(budget_id: budget.id, filter: 'without_valuator')
expect(page).to have_content("Assigned idea")
expect(page).not_to have_content("Evaluating...")
expect(page).not_to have_content("With group")
end
scenario "Filtering by valuation status" do