nettoyage du tag_substitution_concern

This commit is contained in:
clemkeirua 2019-04-24 09:42:30 +02:00
parent b3956bc072
commit e4259466b4
2 changed files with 3 additions and 4 deletions

View file

@ -62,7 +62,7 @@ module TagsSubstitutionConcern
lambda: -> (d) { lambda: -> (d) {
links = [external_link(attestation_dossier_url(d))] links = [external_link(attestation_dossier_url(d))]
if d.justificatif_motivation.attached? if d.justificatif_motivation.attached?
links.push external_link_with_body("Télécharger le justificatif", url_for_justificatif_motivation(d)) links.push external_link_with_body("Télécharger l'attestation", url_for_justificatif_motivation(d))
end end
links.join "<br />\n" links.join "<br />\n"
}, },

View file

@ -77,9 +77,8 @@ describe MailTemplateConcern do
describe "in closed mail without justificatif" do describe "in closed mail without justificatif" do
let(:mail) { create(:closed_mail, procedure: procedure) } let(:mail) { create(:closed_mail, procedure: procedure) }
it { is_expected.to eq("<a target=\"_blank\" rel=\"noopener\" href=\"http://localhost:3000/dossiers/#{dossier.id}/attestation\">http://localhost:3000/dossiers/#{dossier.id}/attestation</a>") } it { is_expected.to eq("<a target=\"_blank\" rel=\"noopener\" href=\"http://localhost:3000/dossiers/#{dossier.id}/attestation\">http://localhost:3000/dossiers/#{dossier.id}/attestation</a>") }
it { is_expected.to_not include("Télécharger le justificatif") } it { is_expected.to_not include("Télécharger l&#39;attestation") }
end end
describe "in closed mail with justificatif" do describe "in closed mail with justificatif" do
@ -90,7 +89,7 @@ describe MailTemplateConcern do
it { expect(dossier.justificatif_motivation).to be_attached } it { expect(dossier.justificatif_motivation).to be_attached }
it { is_expected.to start_with("<a target=\"_blank\" rel=\"noopener\" href=\"http://localhost:3000/dossiers/#{dossier.id}/attestation\">http://localhost:3000/dossiers/#{dossier.id}/attestation</a><br />\n") } it { is_expected.to start_with("<a target=\"_blank\" rel=\"noopener\" href=\"http://localhost:3000/dossiers/#{dossier.id}/attestation\">http://localhost:3000/dossiers/#{dossier.id}/attestation</a><br />\n") }
it { is_expected.to include("Télécharger le justificatif") } it { is_expected.to include("Télécharger l&#39;attestation") }
end end
describe "in refuse mail" do describe "in refuse mail" do