extraction de variables

This commit is contained in:
Jérémy Lecour 2021-01-01 22:34:14 +01:00
parent d5a3f11137
commit d51f461476

View file

@ -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