Merge branch 'master' into polls
This commit is contained in:
@@ -15,12 +15,18 @@ describe "Abilities::Common" do
|
||||
let(:own_proposal) { create(:proposal, author: user) }
|
||||
|
||||
let(:accepting_budget) { create(:budget, phase: 'accepting') }
|
||||
let(:reviewing_budget) { create(:budget, phase: 'reviewing') }
|
||||
let(:selecting_budget) { create(:budget, phase: 'selecting') }
|
||||
let(:balloting_budget) { create(:budget, phase: 'balloting') }
|
||||
|
||||
let(:investment_in_accepting_budget) { create(:budget_investment, budget: accepting_budget) }
|
||||
let(:investment_in_reviewing_budget) { create(:budget_investment, budget: reviewing_budget) }
|
||||
let(:investment_in_selecting_budget) { create(:budget_investment, budget: selecting_budget) }
|
||||
let(:investment_in_balloting_budget) { create(:budget_investment, budget: balloting_budget) }
|
||||
let(:own_investment_in_accepting_budget) { create(:budget_investment, budget: accepting_budget, author: user) }
|
||||
let(:own_investment_in_reviewing_budget) { create(:budget_investment, budget: reviewing_budget, author: user) }
|
||||
let(:own_investment_in_selecting_budget) { create(:budget_investment, budget: selecting_budget, author: user) }
|
||||
let(:own_investment_in_balloting_budget) { create(:budget_investment, budget: balloting_budget, author: user) }
|
||||
let(:ballot_in_accepting_budget) { create(:budget_ballot, budget: accepting_budget) }
|
||||
let(:ballot_in_selecting_budget) { create(:budget_ballot, budget: selecting_budget) }
|
||||
let(:ballot_in_balloting_budget) { create(:budget_ballot, budget: balloting_budget) }
|
||||
@@ -191,12 +197,21 @@ describe "Abilities::Common" do
|
||||
it { should_not be_able_to(:vote, investment_in_accepting_budget) }
|
||||
it { should be_able_to(:vote, investment_in_selecting_budget) }
|
||||
it { should_not be_able_to(:vote, 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) }
|
||||
it { should_not be_able_to(:destroy, investment_in_selecting_budget) }
|
||||
it { should_not be_able_to(:destroy, investment_in_balloting_budget) }
|
||||
|
||||
it { should be_able_to(:destroy, own_investment_in_accepting_budget) }
|
||||
it { should be_able_to(:destroy, own_investment_in_reviewing_budget) }
|
||||
it { should_not be_able_to(:destroy, own_investment_in_selecting_budget) }
|
||||
it { should_not be_able_to(:destroy, investment_in_balloting_budget) }
|
||||
|
||||
it { should_not be_able_to(:create, ballot_in_accepting_budget) }
|
||||
it { should_not be_able_to(:create, ballot_in_selecting_budget) }
|
||||
it { should be_able_to(:create, ballot_in_balloting_budget) }
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
describe "when level 3 verified" do
|
||||
|
||||
Reference in New Issue
Block a user