From 327ebf106fea910514debd08adbcc9991dfe88e3 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Mon, 1 Jul 2024 10:25:49 +0200 Subject: [PATCH] fix(mailer): hardcoded application name --- app/mailers/user_mailer.rb | 2 +- spec/mailers/previews/user_mailer_preview.rb | 2 +- spec/mailers/user_mailer_spec.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 08d45509a..58a28f96f 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -94,7 +94,7 @@ class UserMailer < ApplicationMailer def notify_after_closing(user, content, procedure = nil) @user = user - @subject = "Clôture d'une démarche sur Démarches simplifiées" + @subject = "Clôture d'une démarche sur #{Current.application_name}" @procedure = procedure @content = content diff --git a/spec/mailers/previews/user_mailer_preview.rb b/spec/mailers/previews/user_mailer_preview.rb index 6fd487fe2..39b285c9c 100644 --- a/spec/mailers/previews/user_mailer_preview.rb +++ b/spec/mailers/previews/user_mailer_preview.rb @@ -34,7 +34,7 @@ class UserMailerPreview < ActionMailer::Preview end def notify_after_closing - UserMailer.notify_after_closing([user]) + UserMailer.notify_after_closing(user, "Cette démarche est close") end private diff --git a/spec/mailers/user_mailer_spec.rb b/spec/mailers/user_mailer_spec.rb index 0dc7a9212..5090a2e46 100644 --- a/spec/mailers/user_mailer_spec.rb +++ b/spec/mailers/user_mailer_spec.rb @@ -156,7 +156,7 @@ RSpec.describe UserMailer, type: :mailer do it 'notifies user about procedure closing with detailed message' do expect(subject.to).to eq([user.email]) - expect(subject.body).to include("Clôture d'une démarche sur Démarches simplifiées") + expect(subject.body).to include("Clôture d'une démarche sur demarches-simplifiees.fr") expect(subject.body).to include("Bonjour,\r\n
saut de ligne") end