mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
FIX: poll new_post_manager spec
This commit is contained in:
@ -309,8 +309,6 @@ after_initialize do
|
|||||||
end
|
end
|
||||||
|
|
||||||
validate(:post, :validate_polls) do |force = nil|
|
validate(:post, :validate_polls) do |force = nil|
|
||||||
return if !SiteSetting.poll_enabled? && (self.user && !self.user.staff?)
|
|
||||||
|
|
||||||
# only care when raw has changed!
|
# only care when raw has changed!
|
||||||
return unless self.raw_changed? || force
|
return unless self.raw_changed? || force
|
||||||
|
|
||||||
|
@ -5,6 +5,10 @@ describe NewPostManager do
|
|||||||
let(:admin) { Fabricate(:admin) }
|
let(:admin) { Fabricate(:admin) }
|
||||||
|
|
||||||
describe 'when new post containing a poll is queued for approval' do
|
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
|
it 'should render the poll upon approval' do
|
||||||
params = {
|
params = {
|
||||||
raw: "[poll]\n* 1\n* 2\n* 3\n[/poll]",
|
raw: "[poll]\n* 1\n* 2\n* 3\n[/poll]",
|
||||||
|
Reference in New Issue
Block a user