Fix CacheBuster
being queued for missing media attachments (#34253)
This commit is contained in:
parent
b892b15ba6
commit
ef870007e9
2 changed files with 11 additions and 0 deletions
|
@ -302,6 +302,15 @@ RSpec.describe MediaAttachment, :attachment_processing do
|
|||
.to enqueue_sidekiq_job(CacheBusterWorker).with(original_url)
|
||||
.and enqueue_sidekiq_job(CacheBusterWorker).with(small_url)
|
||||
end
|
||||
|
||||
context 'with a missing remote attachment' do
|
||||
let(:media) { Fabricate(:media_attachment, remote_url: 'https://example.com/foo.png', file: nil) }
|
||||
|
||||
it 'does not queue CacheBusterWorker jobs' do
|
||||
expect { media.destroy }
|
||||
.to_not enqueue_sidekiq_job(CacheBusterWorker)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue