mailers: add a NO_REPLY address to transactional emails

This commit is contained in:
Chaïb Martinez 2019-09-10 11:29:06 +00:00 committed by Pierre de La Morinerie
parent aa1cf6788b
commit dd6c6bfe7a
6 changed files with 17 additions and 3 deletions

View file

@ -4,6 +4,10 @@ RSpec.describe DossierMailer, type: :mailer do
let(:to_email) { 'instructeur@exemple.gouv.fr' }
shared_examples 'a dossier notification' do
it 'is sent from a no-reply address' do
expect(subject.from.first).to eq(Mail::Address.new(NO_REPLY_EMAIL).address)
end
it 'includes the contact informations in the footer' do
expect(subject.body).to include('ne pas répondre')
end

View file

@ -56,5 +56,9 @@ RSpec.describe NotificationMailer, type: :mailer do
expect(mail.body).not_to include('iframe')
end
end
it 'sends the mail from a no-reply address' do
expect(subject.from.first).to eq(Mail::Address.new(NO_REPLY_EMAIL).address)
end
end
end