mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 04:31:10 +08:00
FEATURE: option to skip posts with ignored missing uploads
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user