views: tell an attestation will be sent only if it is true

Previously the message stating "an attestation will be sent" was
displayed even when the attestation was disabled.
This commit is contained in:
Pierre de La Morinerie 2019-10-14 15:34:04 +02:00
parent 17d8167390
commit 0064c2c610
2 changed files with 4 additions and 2 deletions

View file

@ -6,6 +6,7 @@
= form_tag(terminer_instructeur_dossier_path(dossier.procedure, dossier), remote: true, method: :post, class: 'form') do
- if title == 'Accepter'
= text_area :dossier, :motivation, class: 'motivation-text-area', placeholder: placeholder, required: false
- if dossier.procedure.attestation_template&.activated?
%p.help
L'acceptation du dossier envoie automatiquement une attestation à l'usager.

View file

@ -20,6 +20,7 @@ describe 'instructeurs/dossiers/state_button_motivation.html.haml', type: :view
end
context 'without an attestation preview' do
it { expect(rendered).not_to have_text("envoie automatiquement une attestation") }
it { expect(rendered).not_to have_text("Voir l'attestation") }
end
end