From a1a11adb83171c1715bf33682efd79d7b9db0597 Mon Sep 17 00:00:00 2001 From: maatinito <15379878+maatinito@users.noreply.github.com> Date: Thu, 20 Dec 2018 09:49:14 +0100 Subject: [PATCH] [#325] Make the notification layout inherit from the general layout --- app/views/layouts/mailers/notification.html.haml | 15 ++++++--------- spec/mailers/notification_mailer_spec.rb | 4 ++-- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/app/views/layouts/mailers/notification.html.haml b/app/views/layouts/mailers/notification.html.haml index 65200ed40..b2fb59b7c 100644 --- a/app/views/layouts/mailers/notification.html.haml +++ b/app/views/layouts/mailers/notification.html.haml @@ -1,10 +1,7 @@ -= yield +- content_for :footer do + %strong + Merci de ne pas répondre à cet email. Pour vous adresser à votre administration, passez directement par votre + = succeed '.' do + = link_to 'messagerie', messagerie_dossier_url(@dossier), target: '_blank' -%footer - %p - — - %br - %strong - Merci de ne pas répondre à cet email. Pour vous adresser à votre administration, passez directement par votre - = succeed '.' do - = link_to 'messagerie', messagerie_dossier_url(@dossier), target: '_blank' += render template: 'layouts/mailers/layout' diff --git a/spec/mailers/notification_mailer_spec.rb b/spec/mailers/notification_mailer_spec.rb index 1be85a653..89a1c9333 100644 --- a/spec/mailers/notification_mailer_spec.rb +++ b/spec/mailers/notification_mailer_spec.rb @@ -34,7 +34,7 @@ RSpec.describe NotificationMailer, type: :mailer do it { expect(mail.subject).to eq(email_template.subject_for_dossier) } it { expect(mail.body).to include(email_template.body_for_dossier) } - it { expect(mail.body).to have_selector('footer') } + it { expect(mail.body).to have_link('messagerie') } it_behaves_like "create a commentaire not notified" end @@ -50,7 +50,7 @@ RSpec.describe NotificationMailer, type: :mailer do it do expect(mail.subject).to eq(email_template.subject) expect(mail.body).to include(email_template.body) - expect(mail.body).to have_selector('footer') + expect(mail.body).to have_link('messagerie') end it_behaves_like "create a commentaire not notified"