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