commit
7333808069
3 changed files with 4 additions and 2 deletions
|
@ -6,6 +6,8 @@
|
||||||
# The subject and body of a Notification can be customized by each demarche.
|
# The subject and body of a Notification can be customized by each demarche.
|
||||||
#
|
#
|
||||||
class NotificationMailer < ApplicationMailer
|
class NotificationMailer < ApplicationMailer
|
||||||
|
helper ServiceHelper
|
||||||
|
|
||||||
def send_dossier_received(dossier)
|
def send_dossier_received(dossier)
|
||||||
send_notification(dossier, dossier.procedure.received_mail_template)
|
send_notification(dossier, dossier.procedure.received_mail_template)
|
||||||
end
|
end
|
||||||
|
|
|
@ -19,7 +19,7 @@ FactoryBot.define do
|
||||||
end
|
end
|
||||||
|
|
||||||
trait :with_service do
|
trait :with_service do
|
||||||
after(:build) do |dossier, _evaluator|
|
after(:create) do |dossier, _evaluator|
|
||||||
dossier.procedure.service = create(:service)
|
dossier.procedure.service = create(:service)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,7 +13,7 @@ RSpec.describe NotificationMailer, type: :mailer do
|
||||||
end
|
end
|
||||||
|
|
||||||
let(:user) { create(:user) }
|
let(:user) { create(:user) }
|
||||||
let(:dossier) { create(:dossier, user: user) }
|
let(:dossier) { create(:dossier, :with_service, user: user) }
|
||||||
|
|
||||||
describe '.send_notification' do
|
describe '.send_notification' do
|
||||||
let(:email_template) { instance_double('email_template', subject_for_dossier: 'subject', body_for_dossier: 'body') }
|
let(:email_template) { instance_double('email_template', subject_for_dossier: 'subject', body_for_dossier: 'body') }
|
||||||
|
|
Loading…
Reference in a new issue