EvoBal/test/services/email_importer_test.rb

15 lines
452 B
Ruby

require 'test_helper'
class EmailImporterTest < ActiveSupport::TestCase
test "convert html to text when html only" do
eml = file_fixture("html_only.eml").read
mail = Mail.from_source(eml)
email_importer = EmailImporter.new
email = email_importer.import(mail)
assert_match(/Attention, plus que quelques jours pour bénéficier du FNE !/, email.plain_body)
assert_no_match(/<\/?(p|b|br|img)\/?>/, email.plain_body)
end
end