This commit is contained in:
KMY 2025-04-03 07:17:26 +09:00
parent 28a08ce478
commit f24f83d9b0
2 changed files with 5 additions and 5 deletions

View file

@ -31,7 +31,7 @@ RSpec.describe Settings::PrivacyController do
describe 'PUT #update' do
context 'when update succeeds' do
before do
allow(ActivityPub::UpdateDistributionWorker).to receive(:perform_async)
allow(ActivityPub::UpdateDistributionWorker).to receive(:perform_in)
end
it 'updates the user profile' do
@ -44,14 +44,14 @@ RSpec.describe Settings::PrivacyController do
.to redirect_to(settings_privacy_path)
expect(ActivityPub::UpdateDistributionWorker)
.to have_received(:perform_async).with(account.id)
.to have_received(:perform_in).with(ActivityPub::UpdateDistributionWorker::DEBOUNCE_DELAY, account.id)
end
end
context 'when update fails' do
before do
allow(UpdateAccountService).to receive(:new).and_return(failing_update_service)
allow(ActivityPub::UpdateDistributionWorker).to receive(:perform_async)
allow(ActivityPub::UpdateDistributionWorker).to receive(:perform_in)
end
it 'updates the user profile' do
@ -61,7 +61,7 @@ RSpec.describe Settings::PrivacyController do
.to render_template(:show)
expect(ActivityPub::UpdateDistributionWorker)
.to_not have_received(:perform_async)
.to_not have_received(:perform_in)
end
private