1
0
mirror of https://github.com/mastodon/mastodon synced 2024-11-23 22:56:20 +09:00

Use sidekiq_inline in requests/api/v1/admin/account_actions spec (#30563)

This commit is contained in:
Matt Jankowski 2024-06-06 10:19:22 -04:00 committed by GitHub
parent 9b9b0e25b6
commit 07cc94e05f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,10 +10,16 @@ RSpec.describe 'Account actions' do
let(:headers) { { 'Authorization' => "Bearer #{token.token}" } }
shared_examples 'a successful notification delivery' do
it 'notifies the user about the action taken' do
expect { subject }
.to have_enqueued_job(ActionMailer::MailDeliveryJob)
.with('UserMailer', 'warning', 'deliver_now!', args: [User, AccountWarning])
it 'notifies the user about the action taken', :sidekiq_inline do
emails = capture_emails { subject }
expect(emails.size)
.to eq(1)
expect(emails.first)
.to have_attributes(
to: contain_exactly(target_account.user.email)
)
end
end