Added check in poll card that allows setting the value of
results_enabled flag.

Access to stats/results now is controlled with abilities.

Polls related to proposals will be accessible to the proposal author
like they were administrators.
This commit is contained in:
Juan Salvador Pérez García
2018-07-13 10:39:49 +02:00
parent 0daaf9e7db
commit f439fc7371
16 changed files with 93 additions and 10 deletions

View File

@@ -167,8 +167,12 @@ describe Abilities::Common do
end
describe 'proposal polls' do
let(:poll) { create(:poll, related: own_proposal) }
it { should be_able_to(:manage_polls, own_proposal) }
it { should_not be_able_to(:manage_polls, proposal) }
it { should_not be_able_to(:stats, poll) }
it { should be_able_to(:results, poll) }
end
describe 'publishing proposals' do