Fixes #218
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:
@@ -6,6 +6,7 @@ describe Abilities::Administrator do
|
||||
|
||||
let(:user) { administrator.user }
|
||||
let(:administrator) { create(:administrator) }
|
||||
let(:poll) { create(:poll, :current, stats_enabled: false, results_enabled: false) }
|
||||
|
||||
let(:other_user) { create(:user) }
|
||||
let(:hidden_user) { create(:user, :hidden) }
|
||||
@@ -91,6 +92,9 @@ describe Abilities::Administrator do
|
||||
it { should_not be_able_to(:destroy, budget_investment_document) }
|
||||
it { should be_able_to(:manage, ProposalDashboardAction) }
|
||||
|
||||
it { should be_able_to(:stats, poll) }
|
||||
it { should be_able_to(:results, poll) }
|
||||
|
||||
it { is_expected.to be_able_to :manage, AdministratorTask }
|
||||
it { is_expected.to be_able_to :manage, administrator_task }
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user