FIX: poll new_post_manager spec

This commit is contained in:
Joffrey JAFFEUX 2017-12-04 16:12:40 +01:00 committed by GitHub
parent 63bab32816
commit 1e0bfa1d97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -309,8 +309,6 @@ after_initialize do
end
validate(:post, :validate_polls) do |force = nil|
return if !SiteSetting.poll_enabled? && (self.user && !self.user.staff?)
# only care when raw has changed!
return unless self.raw_changed? || force

View File

@ -5,6 +5,10 @@ describe NewPostManager do
let(:admin) { Fabricate(:admin) }
describe 'when new post containing a poll is queued for approval' do
before do
SiteSetting.poll_minimum_trust_level_to_create = 0
end
it 'should render the poll upon approval' do
params = {
raw: "[poll]\n* 1\n* 2\n* 3\n[/poll]",