extraction de helpers de test

This commit is contained in:
Jérémy Lecour 2020-12-31 15:32:57 +01:00
parent 5a61c51ded
commit a05c66d9a8

View file

@ -10,4 +10,16 @@ class ActiveSupport::TestCase
fixtures :all
# Add more helper methods to be used by all tests here...
def email_from_eml(file_fixture_name)
eml = file_fixture(file_fixture_name).read
mail = Mail.from_source(eml)
email_importer = EmailImporter.new
email_importer.import(mail)
end
def assert_no_html(text)
assert_no_match(/<\/?(p|b|br|img)\/?>/, text)
end
end