-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LG-12294: Fix asynchronous email delivery for aggregated sign-in email (
#10421) * Fix asynchronous email delivery for aggregated sign-in email changelog: Upcoming Features, Sign In, Send single aggregated email notification for new device sign-in * Add exclusion for current sync-only mailers * Default synchronous_only to false
- Loading branch information
Showing
4 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe UserMailer, type: :mailer do | ||
let(:user) { build(:user) } | ||
let(:user) { create(:user) } | ||
let(:email_address) { user.email_addresses.first } | ||
let(:banned_email) { '[email protected]' } | ||
let(:banned_email_address) { create(:email_address, email: banned_email, user: user) } | ||
|
@@ -205,6 +205,32 @@ | |
end | ||
end | ||
|
||
describe '#new_device_sign_in_before_2fa' do | ||
let(:event) { create(:event, event_type: :sign_in_before_2fa, user:, device: create(:device)) } | ||
subject(:mail) do | ||
UserMailer.with(user:, email_address:).new_device_sign_in_before_2fa( | ||
events: user.events.where(event_type: 'sign_in_before_2fa').includes(:device).to_a, | ||
disavowal_token: 'token', | ||
) | ||
end | ||
|
||
it_behaves_like 'a system email' | ||
it_behaves_like 'an email that respects user email locale preference' | ||
end | ||
|
||
describe '#new_device_sign_in_after_2fa' do | ||
let(:event) { create(:event, event_type: :sign_in_after_2fa, user:, device: create(:device)) } | ||
subject(:mail) do | ||
UserMailer.with(user:, email_address:).new_device_sign_in_after_2fa( | ||
events: user.events.where(event_type: 'sign_in_after_2fa').includes(:device).to_a, | ||
disavowal_token: 'token', | ||
) | ||
end | ||
|
||
it_behaves_like 'a system email' | ||
it_behaves_like 'an email that respects user email locale preference' | ||
end | ||
|
||
describe '#personal_key_regenerated' do | ||
let(:mail) do | ||
UserMailer.with(user: user, email_address: email_address).personal_key_regenerated | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters