diff --git a/app/models/queued_post.rb b/app/models/queued_post.rb index 232d86e21..f93e7e8f1 100644 --- a/app/models/queued_post.rb +++ b/app/models/queued_post.rb @@ -51,7 +51,7 @@ class QueuedPost < ActiveRecord::Base QueuedPost.transaction do change_to!(:approved, approved_by) - creator = PostCreator.new(user, create_options) + creator = PostCreator.new(user, create_options.merge(skip_validations: true)) created_post = creator.create end created_post diff --git a/spec/models/queued_post_spec.rb b/spec/models/queued_post_spec.rb index bc1289b44..7ddeaed5b 100644 --- a/spec/models/queued_post_spec.rb +++ b/spec/models/queued_post_spec.rb @@ -41,7 +41,12 @@ describe QueuedPost do # We can't approve twice expect(-> { qp.approve!(admin) }).to raise_error(QueuedPost::InvalidStateTransition) + end + it "skips validations" do + qp.post_options[:title] = 'too short' + post = qp.approve!(admin) + expect(post).to be_present end it "follows the correct workflow for rejection" do