Add abilities to documentable authors and admins to create and destroy documents.
This commit is contained in:
@@ -12,8 +12,12 @@ describe "Abilities::Administrator" do
|
||||
let(:debate) { create(:debate) }
|
||||
let(:comment) { create(:comment) }
|
||||
let(:proposal) { create(:proposal) }
|
||||
let(:budget_investment) { create(:budget_investment) }
|
||||
let(:legislation_question) { create(:legislation_question) }
|
||||
|
||||
let(:proposal_document) { build(:document, documentable: proposal) }
|
||||
let(:budget_investment_document) { build(:document, documentable: budget_investment) }
|
||||
|
||||
let(:hidden_debate) { create(:debate, :hidden) }
|
||||
let(:hidden_comment) { create(:comment, :hidden) }
|
||||
let(:hidden_proposal) { create(:proposal, :hidden) }
|
||||
@@ -71,4 +75,12 @@ describe "Abilities::Administrator" do
|
||||
|
||||
it { should be_able_to(:valuate, create(:budget_investment, budget: create(:budget, phase: 'valuating'))) }
|
||||
it { should be_able_to(:valuate, create(:budget_investment, budget: create(:budget, phase: 'finished'))) }
|
||||
|
||||
it { should be_able_to(:new, proposal_document) }
|
||||
it { should be_able_to(:create, proposal_document) }
|
||||
it { should be_able_to(:destroy, proposal_document) }
|
||||
|
||||
it { should be_able_to(:new, budget_investment_document) }
|
||||
it { should be_able_to(:create, budget_investment_document) }
|
||||
it { should be_able_to(:destroy, budget_investment_document) }
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user