Merge branch 'master' into legislation-module-stable

This commit is contained in:
Amaia Castro
2017-03-07 23:19:26 +01:00
25 changed files with 114 additions and 43 deletions

View File

@@ -10,12 +10,18 @@ describe "Abilities::Common" do
let(:comment) { create(:comment) }
let(:proposal) { create(:proposal) }
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) }
@@ -117,6 +123,16 @@ describe "Abilities::Common" do
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) }