diff --git a/spec/factories.rb b/spec/factories.rb index 7b1f6a417..ce92c88d3 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -380,6 +380,10 @@ FactoryGirl.define do trait :budget_investment_document do association :documentable, factory: :budget_investment end + + trait :poll_question_document do + association :documentable, factory: :poll_question + end end factory :comment do diff --git a/spec/models/abilities/administrator_spec.rb b/spec/models/abilities/administrator_spec.rb index bbec927a0..dcb099ecd 100644 --- a/spec/models/abilities/administrator_spec.rb +++ b/spec/models/abilities/administrator_spec.rb @@ -14,9 +14,11 @@ describe "Abilities::Administrator" do let(:proposal) { create(:proposal) } let(:budget_investment) { create(:budget_investment) } let(:legislation_question) { create(:legislation_question) } + let(:poll_question) { create(:poll_question) } let(:proposal_document) { build(:document, documentable: proposal) } let(:budget_investment_document) { build(:document, documentable: budget_investment) } + let(:poll_question_document) { build(:document, documentable: poll_question) } let(:hidden_debate) { create(:debate, :hidden) } let(:hidden_comment) { create(:comment, :hidden) } @@ -83,4 +85,8 @@ describe "Abilities::Administrator" do 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) } + + it { should be_able_to(:new, poll_question_document) } + it { should be_able_to(:create, poll_question_document) } + it { should be_able_to(:destroy, poll_question_document) } end