feat(UserMailer.france_connect_merge_confirmation): in addition to distance_of_time_in_words, add exact expiration date
This commit is contained in:
parent
21894d0a0a
commit
8a315a4ac1
4 changed files with 5 additions and 4 deletions
|
@ -20,8 +20,9 @@ class UserMailer < ApplicationMailer
|
|||
mail(to: requested_email, subject: @subject)
|
||||
end
|
||||
|
||||
def france_connect_merge_confirmation(email, merge_token)
|
||||
def france_connect_merge_confirmation(email, merge_token, merge_token_created_at)
|
||||
@merge_token = merge_token
|
||||
@merge_token_created_at = merge_token_created_at
|
||||
@subject = "Veuillez confirmer la fusion de compte"
|
||||
|
||||
mail(to: email, subject: @subject)
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
%p
|
||||
Vous pouvez aussi visiter ce lien : #{link_to france_connect_particulier_mail_merge_with_existing_account_url(merge_token: @merge_token), france_connect_particulier_mail_merge_with_existing_account_url(merge_token: @merge_token)}
|
||||
|
||||
%p Ce lien est valide #{distance_of_time_in_words(FranceConnectInformation::MERGE_VALIDITY)}.
|
||||
%p Ce lien est valide #{distance_of_time_in_words(FranceConnectInformation::MERGE_VALIDITY)}, jusqu'à #{I18n.l(@merge_token_created_at, format: "%d-%m-%Y à %H:%M (%Z)")}
|
||||
|
||||
%p
|
||||
Si vous n’êtes pas à l’origine de cette demande, vous pouvez ignorer ce message. Et si vous avez besoin d’assistance, n’hésitez pas à nous contacter à
|
||||
|
|
|
@ -13,7 +13,7 @@ class UserMailerPreview < ActionMailer::Preview
|
|||
end
|
||||
|
||||
def france_connect_merge_confirmation
|
||||
UserMailer.france_connect_merge_confirmation('new.exemple.fr', '123456')
|
||||
UserMailer.france_connect_merge_confirmation('new.exemple.fr', '123456', 15.minutes.from_now)
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -30,7 +30,7 @@ RSpec.describe UserMailer, type: :mailer do
|
|||
let(:email) { 'new.exemple.fr' }
|
||||
let(:code) { '123456' }
|
||||
|
||||
subject { described_class.france_connect_merge_confirmation(email, code) }
|
||||
subject { described_class.france_connect_merge_confirmation(email, code, 15.minutes.from_now) }
|
||||
|
||||
it { expect(subject.to).to eq([email]) }
|
||||
it { expect(subject.body).to include(france_connect_particulier_mail_merge_with_existing_account_url(merge_token: code)) }
|
||||
|
|
Loading…
Reference in a new issue