Add coverage for missing user scenario in user/appeal mailers (#39496)

This commit is contained in:
Matt Jankowski
2026-06-22 05:59:45 -04:00
committed by GitHub
parent 7f7e7343cf
commit 4dbc4b0e29

View File

@@ -210,6 +210,15 @@ RSpec.describe UserMailer do
expect(mail.text_part.body)
.to match(I18n.t('user_mailer.appeal_approved.title'))
end
context 'when user is missing' do
let(:mail) { described_class.appeal_approved(nil, appeal) }
it 'handles missing value without sending' do
expect { mail.deliver }
.to_not send_email
end
end
end
describe '#appeal_rejected' do
@@ -222,6 +231,15 @@ RSpec.describe UserMailer do
expect(mail.text_part.body)
.to match(I18n.t('user_mailer.appeal_rejected.title'))
end
context 'when user is missing' do
let(:mail) { described_class.appeal_rejected(nil, appeal) }
it 'handles missing value without sending' do
expect { mail.deliver }
.to_not send_email
end
end
end
describe '#two_factor_enabled' do