Trim valuator investment valuation ability scope
Valuators shouldn't be able to valuate an investment which valuation has already been finished (only admins can)
This commit is contained in:
@@ -19,6 +19,12 @@ describe Abilities::Valuator do
|
||||
it { should be_able_to(:update, SpendingProposal) }
|
||||
it { should be_able_to(:valuate, SpendingProposal) }
|
||||
|
||||
it "cannot valuate an assigned investment with a finished valuation" do
|
||||
assigned_investment.update(valuation_finished: true)
|
||||
|
||||
should_not be_able_to(:valuate, assigned_investment)
|
||||
end
|
||||
|
||||
it { should_not be_able_to(:update, non_assigned_investment) }
|
||||
it { should_not be_able_to(:valuate, non_assigned_investment) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user