Extract controllers to support investments
Since we're going to add an action to remove supports, having a separate controller makes things easier. Note there was a strange piece of code which assumed users were not verified if they couldn't vote investments. Now the code is also strange, since it assumes users are not verified if they can't create votes. We might need to revisit these conditions if our logic changes in the future.
This commit is contained in:
@@ -248,9 +248,9 @@ describe Abilities::Common do
|
||||
it { should_not be_able_to(:create, investment_in_selecting_budget) }
|
||||
it { should_not be_able_to(:create, investment_in_balloting_budget) }
|
||||
|
||||
it { should be_able_to(:vote, investment_in_selecting_budget) }
|
||||
it { should_not be_able_to(:vote, investment_in_accepting_budget) }
|
||||
it { should_not be_able_to(:vote, investment_in_balloting_budget) }
|
||||
it { should be_able_to(:create, user.votes.build(votable: investment_in_selecting_budget)) }
|
||||
it { should_not be_able_to(:create, user.votes.build(votable: investment_in_accepting_budget)) }
|
||||
it { should_not be_able_to(:create, user.votes.build(votable: investment_in_balloting_budget)) }
|
||||
|
||||
it { should_not be_able_to(:destroy, investment_in_accepting_budget) }
|
||||
it { should_not be_able_to(:destroy, investment_in_reviewing_budget) }
|
||||
|
||||
Reference in New Issue
Block a user