mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
allow skipping the validations on creation if its an api call AND skip_validations is specified
this allows wordpress plugin to post very very short titles or titles that would otherwise be disallowed
This commit is contained in:
@ -341,5 +341,13 @@ describe PostCreator do
|
||||
post.created_at.should be_within(10.seconds).of(created_at)
|
||||
end
|
||||
end
|
||||
|
||||
context 'disable validations' do
|
||||
it 'can save a post' do
|
||||
creator = PostCreator.new(user, raw: 'q', title: 'q', skip_validations: true)
|
||||
post = creator.create
|
||||
creator.errors.should be_nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user