From c6f09e886793a2a618a0b806b8fc27f8f71dfdab Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 20 May 2016 14:16:36 +0200 Subject: [PATCH] Added

test for html_mail_client_fixes(). --- app/models/channel/email_build.rb | 6 +++--- test/unit/email_build_test.rb | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/models/channel/email_build.rb b/app/models/channel/email_build.rb index 6778481c9..22c8082ca 100644 --- a/app/models/channel/email_build.rb +++ b/app/models/channel/email_build.rb @@ -241,9 +241,9 @@ Add/change markup to display html in any mail client nice. def self.html_mail_client_fixes(html) # https://github.com/martini/zammad/issues/165 - html.gsub!('

', '
') - html.gsub('

', '

') - + new_html = html.gsub('

', '
') + new_html.gsub!('

', '

') + new_html end end diff --git a/test/unit/email_build_test.rb b/test/unit/email_build_test.rb index 1eecdbe9a..4c592a347 100644 --- a/test/unit/email_build_test.rb +++ b/test/unit/email_build_test.rb @@ -175,7 +175,6 @@ text text

' html_with_fixes = Channel::EmailBuild.html_mail_client_fixes(html_raw) - assert_not_equal(html_with_fixes, html_raw) html_should = '
some @@ -187,9 +186,20 @@ text
some text
' - assert_equal(html_should, html_with_fixes) + html_raw = '

some +text +

+

123

' + html_with_fixes = Channel::EmailBuild.html_mail_client_fixes(html_raw) + assert_not_equal(html_with_fixes, html_raw) + + html_should = '

some +text +

+

123

' + assert_equal(html_should, html_with_fixes) end end