From 5d13bdc15dd65fce32ec2cdf95a96a0db2a415b1 Mon Sep 17 00:00:00 2001 From: kikito Date: Sun, 29 Jan 2017 22:25:10 +0100 Subject: [PATCH] Removes 'manage' from admin permissions in Polls --- app/models/abilities/administrator.rb | 4 ++-- spec/features/admin/poll/booth_assigments_spec.rb | 3 ++- spec/models/abilities/administrator_spec.rb | 3 --- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/models/abilities/administrator.rb b/app/models/abilities/administrator.rb index a45eef73e..34adac19b 100644 --- a/app/models/abilities/administrator.rb +++ b/app/models/abilities/administrator.rb @@ -53,8 +53,8 @@ module Abilities can [:index, :create, :edit, :update, :destroy], Geozone - can [:manage], Poll - can [:manage], Poll::Booth + can [:read, :create, :update, :destroy, :add_question, :remove_question, :search_booths, :search_questions, :search_officers], Poll + can [:read, :create, :update, :destroy], Poll::Booth can [:search, :create, :index, :destroy], ::Poll::Officer can [:create, :destroy], ::Poll::BoothAssignment can [:create, :destroy], ::Poll::OfficerAssignment diff --git a/spec/features/admin/poll/booth_assigments_spec.rb b/spec/features/admin/poll/booth_assigments_spec.rb index 28d612257..14a8ba1e1 100644 --- a/spec/features/admin/poll/booth_assigments_spec.rb +++ b/spec/features/admin/poll/booth_assigments_spec.rb @@ -20,6 +20,7 @@ feature 'Admin booths assignments' do fill_in 'search-booths', with: booth.name click_button 'Search' + expect(page).to have_content(booth.name) within('#search-booths-results') do click_link 'Assign booth' @@ -167,4 +168,4 @@ feature 'Admin booths assignments' do end end -end \ No newline at end of file +end diff --git a/spec/models/abilities/administrator_spec.rb b/spec/models/abilities/administrator_spec.rb index c368667dd..5312221b8 100644 --- a/spec/models/abilities/administrator_spec.rb +++ b/spec/models/abilities/administrator_spec.rb @@ -57,9 +57,6 @@ describe "Abilities::Administrator" do it { should be_able_to(:valuate, SpendingProposal) } it { should be_able_to(:destroy, SpendingProposal) } - it { should be_able_to(:manage, Poll) } - it { should be_able_to(:manage, Poll::Booth) } - it { should be_able_to(:create, Budget) } it { should be_able_to(:update, Budget) }