Merge remote-tracking branch 'parent/main' into upstream-20240813

This commit is contained in:
KMY 2024-08-13 07:01:38 +09:00
commit e7ccc0539f
358 changed files with 4653 additions and 4261 deletions

View file

@ -292,6 +292,25 @@ RSpec.describe MediaAttachment, :attachment_processing do
end
end
describe 'cache deletion hooks' do
let(:media) { Fabricate(:media_attachment) }
before do
allow(Rails.configuration.x).to receive(:cache_buster_enabled).and_return(true)
end
it 'queues CacheBusterWorker jobs' do
original_path = media.file.path(:original)
small_path = media.file.path(:small)
thumbnail_path = media.thumbnail.path(:original)
expect { media.destroy }
.to enqueue_sidekiq_job(CacheBusterWorker).with(original_path)
.and enqueue_sidekiq_job(CacheBusterWorker).with(small_path)
.and enqueue_sidekiq_job(CacheBusterWorker).with(thumbnail_path)
end
end
private
def media_metadata

View file

@ -9,7 +9,7 @@ RSpec.describe NotificationPolicy do
let(:sender) { Fabricate(:account) }
before do
Fabricate.times(2, :notification, account: subject.account, activity: Fabricate(:status, account: sender), filtered: true)
Fabricate.times(2, :notification, account: subject.account, activity: Fabricate(:status, account: sender), filtered: true, type: :mention)
Fabricate(:notification_request, account: subject.account, from_account: sender)
subject.summarize!
end

View file

@ -8,7 +8,7 @@ RSpec.describe NotificationRequest do
context 'when there are remaining notifications' do
before do
Fabricate(:notification, account: subject.account, activity: Fabricate(:status, account: subject.from_account), filtered: true)
Fabricate(:notification, account: subject.account, activity: Fabricate(:status, account: subject.from_account), filtered: true, type: :mention)
subject.reconsider_existence!
end