test<\/b>/, 'test 2')
end
test 'html email check' do
html = '
> Welcome!
>
> Thank you for installing Zammad.
>
'
mail = Channel::EmailBuild.build(
:from => 'sender@example.com',
:to => 'recipient@example.com',
:body => html,
:content_type => 'text/html',
)
should = '> Welcome!
>
> Thank you for installing Zammad.
>
'
assert_equal( should, mail.text_part.body.to_s )
assert_equal( html, mail.html_part.body.to_s )
end
test 'html2text' do
html = '
> Welcome!
>
> Thank you for installing Zammad.
>
'
should = '> Welcome!
>
> Thank you for installing Zammad.
>
'
assert_equal( should, html.html2text )
html = ' line 1
you
-----&'
should = 'line 1
you
-----&'
assert_equal( should, html.html2text )
html = ' '
should = '* #1
* #2'
assert_equal( should, html.html2text )
end
end