Fix specs
This commit is contained in:
@@ -6,8 +6,8 @@ module Abilities
|
||||
valuator = user.valuator
|
||||
|
||||
can [:read, :update, :valuate], SpendingProposal
|
||||
can [:read, :update, :comment_valuation], Budget::Investment, id: valuator.investment_ids + valuator.valuator_group.investment_ids
|
||||
can [:valuate], Budget::Investment, { id: valuator.investment_ids + valuator.valuator_group.investment_ids, valuation_finished: false }
|
||||
can [:read, :update, :comment_valuation], Budget::Investment, id: valuator.assigned_investment_ids
|
||||
can [:valuate], Budget::Investment, { id: valuator.assigned_investment_ids, valuation_finished: false }
|
||||
cannot [:update, :valuate, :comment_valuation], Budget::Investment, budget: { phase: 'finished' }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -87,9 +87,9 @@ feature 'Admin budget investments' do
|
||||
end
|
||||
|
||||
scenario 'Display valuator group assignments' do
|
||||
budget_investment1 = create(:budget_investment, budget: @budget)
|
||||
budget_investment2 = create(:budget_investment, budget: @budget)
|
||||
budget_investment3 = create(:budget_investment, budget: @budget)
|
||||
budget_investment1 = create(:budget_investment, budget: budget)
|
||||
budget_investment2 = create(:budget_investment, budget: budget)
|
||||
budget_investment3 = create(:budget_investment, budget: budget)
|
||||
|
||||
health_group = create(:valuator_group, name: "Health")
|
||||
culture_group = create(:valuator_group, name: "Culture")
|
||||
@@ -97,7 +97,7 @@ feature 'Admin budget investments' do
|
||||
budget_investment1.valuator_groups << health_group
|
||||
budget_investment2.valuator_group_ids = [health_group.id, culture_group.id]
|
||||
|
||||
visit admin_budget_budget_investments_path(budget_id: @budget.id)
|
||||
visit admin_budget_budget_investments_path(budget_id: budget)
|
||||
|
||||
within("#budget_investment_#{budget_investment1.id}") do
|
||||
expect(page).to have_content("Health")
|
||||
@@ -221,13 +221,13 @@ feature 'Admin budget investments' do
|
||||
health_group = create(:valuator_group, name: "Health")
|
||||
culture_group = create(:valuator_group, name: "Culture")
|
||||
|
||||
budget_investment1 = create(:budget_investment, title: "Build a hospital", budget: @budget)
|
||||
budget_investment1 = create(:budget_investment, title: "Build a hospital", budget: budget)
|
||||
budget_investment1.valuator_groups << health_group
|
||||
|
||||
budget_investment2 = create(:budget_investment, title: "Build a theatre", budget: @budget)
|
||||
budget_investment2 = create(:budget_investment, title: "Build a theatre", budget: budget)
|
||||
budget_investment2.valuator_groups << culture_group
|
||||
|
||||
visit admin_budget_budget_investments_path(budget_id: @budget.id)
|
||||
visit admin_budget_budget_investments_path(budget_id: budget)
|
||||
expect(page).to have_link("Build a hospital")
|
||||
expect(page).to have_link("Build a theatre")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user