mailers: mention the auto_archive in notify_new_draft

This commit is contained in:
Judith 2020-05-20 16:50:48 +02:00 committed by GitHub Action
parent e73086ee4c
commit 59346ee868
3 changed files with 10 additions and 1 deletions

View file

@ -16,6 +16,10 @@
= round_button('Afficher votre dossier', dossier_url(@dossier), :primary)
- if @dossier.procedure.auto_archive_on
%p
Vous pouvez déposer votre dossier jusqu'au #{l(@dossier.procedure.auto_archive_on - 1.day, format: '%-d %B %Y')} à 23 h 59 (heure de #{Rails.application.config.time_zone}).
= render 'layouts/mailers/signature'
- content_for :footer do

View file

@ -86,6 +86,10 @@ FactoryBot.define do
end
end
trait :with_auto_archive do
auto_archive_on { Time.zone.today + 20 }
end
trait :with_type_de_champ do
transient do
types_de_champ_count { 1 }

View file

@ -12,7 +12,7 @@ RSpec.describe DossierMailer, type: :mailer do
end
describe '.notify_new_draft' do
let(:dossier) { create(:dossier, procedure: build(:simple_procedure)) }
let(:dossier) { create(:dossier, procedure: build(:simple_procedure, :with_auto_archive)) }
subject { described_class.notify_new_draft(dossier) }
@ -20,6 +20,7 @@ RSpec.describe DossierMailer, type: :mailer do
it { expect(subject.subject).to include(dossier.procedure.libelle) }
it { expect(subject.body).to include(dossier.procedure.libelle) }
it { expect(subject.body).to include(dossier_url(dossier)) }
it { expect(subject.body).to include("Vous pouvez déposer votre dossier jusqu'au") }
it_behaves_like 'a dossier notification'
end