Reduce factory creation (132 -> 40) in lib/vacuum/* specs (#32498)

This commit is contained in:
Matt Jankowski 2024-10-15 08:54:56 -04:00 committed by GitHub
parent d74c2c583a
commit 0cc21f1ded
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 41 additions and 58 deletions

View file

@ -17,9 +17,9 @@ RSpec.describe Vacuum::MediaAttachmentsVacuum do
let!(:old_unattached_media) { Fabricate(:media_attachment, account_id: nil, created_at: 10.days.ago) }
let!(:new_unattached_media) { Fabricate(:media_attachment, account_id: nil, created_at: 1.hour.ago) }
before { subject.perform }
it 'handles attachments based on metadata details' do
subject.perform
expect(old_remote_media.reload.file) # Remote and past retention period
.to be_blank
expect(old_local_media.reload.file) # Local and past retention