From d51f4614763680d988cc96cc9baf53da756bc010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lecour?= Date: Fri, 1 Jan 2021 22:34:14 +0100 Subject: [PATCH] extraction de variables --- test/services/email_importer_test.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/services/email_importer_test.rb b/test/services/email_importer_test.rb index 5641c4b..de141f4 100644 --- a/test/services/email_importer_test.rb +++ b/test/services/email_importer_test.rb @@ -4,21 +4,27 @@ class EmailImporterTest < ActiveSupport::TestCase test "convert html to text when not multipart html only" do email = email_from_eml("html_only.eml") - assert_match(/Attention, plus que quelques jours pour bénéficier du FNE !/, email.plain_body) + expected = /Attention, plus que quelques jours pour bénéficier du FNE !/ + + assert_match(expected, email.plain_body) assert_no_html email.plain_body end test "convert html to text when multipart and html only" do email = email_from_eml("html_only_multipart.eml") - assert_match(/Complément d''information : suite du ticket 2009P88471/, email.plain_body) + expected = /Complément d''information : suite du ticket 2009P88471/ + + assert_match(expected, email.plain_body) assert_no_html email.plain_body end test "convert html to text when base64-encoded html only" do email = email_from_eml("html_only_base64.eml") - assert_match(/Type: Health and Safety/, email.plain_body) + expected = /Type: Health and Safety/ + + assert_match(expected, email.plain_body) assert_no_html email.plain_body end