2017-03-06 11:51:34 +01:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe MailTemplateConcern do
|
|
|
|
describe '.replace_tags' do
|
|
|
|
let(:dossier) { create :dossier }
|
2017-03-06 22:37:37 +01:00
|
|
|
let(:initiated_mail) { Mails::InitiatedMail.default }
|
2017-03-06 11:51:34 +01:00
|
|
|
|
|
|
|
it 'works' do
|
2017-08-28 11:18:38 +02:00
|
|
|
initiated_mail.object = '[TPS] --numero_dossier-- --libelle_procedure-- --lien_dossier--'
|
2017-03-06 11:51:34 +01:00
|
|
|
expected =
|
2017-04-12 11:18:28 +02:00
|
|
|
"[TPS] #{dossier.id} #{dossier.procedure.libelle} " +
|
2017-04-04 12:09:51 +02:00
|
|
|
"<a target=\"_blank\" href=\"http://localhost:3000/users/dossiers/#{dossier.id}/recapitulatif\">http://localhost:3000/users/dossiers/#{dossier.id}/recapitulatif</a>"
|
2017-03-06 11:51:34 +01:00
|
|
|
|
|
|
|
expect(initiated_mail.object_for_dossier(dossier)).to eq(expected)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|