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:
Sam
2013-07-02 12:22:56 +10:00
parent 68d98ec94e
commit f6b850e7a4
5 changed files with 31 additions and 15 deletions

View File

@ -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