FEATURE: option to skip posts with ignored missing uploads

This commit is contained in:
Vinoth Kannan
2019-05-09 05:11:15 +05:30
parent 7c0cb59741
commit 87cd4701b8
4 changed files with 29 additions and 1 deletions

View File

@ -70,5 +70,17 @@ RSpec.describe "Post rake tasks" do
post.reload
expect(post.custom_fields[Post::MISSING_UPLOADS]).to eq([url])
end
it 'should skip all the posts with "ignored" custom field' do
post = Fabricate(:post, raw: "A sample post <img src='#{url}'>")
post.custom_fields[Post::MISSING_UPLOADS_IGNORED] = true
post.save_custom_fields
upload.destroy!
Rake::Task['posts:missing_uploads'].invoke
post.reload
expect(post.custom_fields[Post::MISSING_UPLOADS]).to be_nil
end
end
end