From e0fd1e52ec78179390433f268fff3f91af03cad5 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Tue, 23 Oct 2018 10:53:17 +0200 Subject: [PATCH] Fixed usage of wrong assert (which resulted in always true/success by checking hard coded values). --- test/unit/aaa_string_test.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/unit/aaa_string_test.rb b/test/unit/aaa_string_test.rb index e1068e711..325e02c84 100644 --- a/test/unit/aaa_string_test.rb +++ b/test/unit/aaa_string_test.rb @@ -991,7 +991,7 @@ html.html2html_strict html = '' (body, attachments_inline) = HtmlSanitizer.replace_inline_images(html) assert_match(//, body) - assert(1, attachments_inline.count) + assert_equal(1, attachments_inline.count) assert_equal('image1.jpeg', attachments_inline[0][:filename]) assert_equal('image/jpeg', attachments_inline[0][:preferences]['Content-Type']) assert_match(/@#{Setting.get('fqdn')}/, attachments_inline[0][:preferences]['Content-ID']) @@ -1000,7 +1000,7 @@ html.html2html_strict html = 'abc' (body, attachments_inline) = HtmlSanitizer.replace_inline_images(html) assert_match(/abc/, body) - assert(1, attachments_inline.count) + assert_equal(1, attachments_inline.count) assert_equal('image1.jpeg', attachments_inline[0][:filename]) assert_equal('image/jpeg', attachments_inline[0][:preferences]['Content-Type']) assert_match(/@#{Setting.get('fqdn')}/, attachments_inline[0][:preferences]['Content-ID']) @@ -1009,7 +1009,7 @@ html.html2html_strict html = 'abc/, body) - assert(1, attachments_inline.count) + assert_equal(1, attachments_inline.count) assert_equal('image1.jpeg', attachments_inline[0][:filename]) assert_equal('image/jpeg', attachments_inline[0][:preferences]['Content-Type']) assert_match(/@#{Setting.get('fqdn')}/, attachments_inline[0][:preferences]['Content-ID']) @@ -1018,12 +1018,12 @@ html.html2html_strict html = 'abc' (body, attachments_inline) = HtmlSanitizer.replace_inline_images(html) assert_match(/abc/, body) - assert(0, attachments_inline.count) + assert_equal(0, attachments_inline.count) html = '

123

' (body, attachments_inline) = HtmlSanitizer.replace_inline_images(html) assert_match(/
\s+

123<\/p>\s+\s+<\/div>/, body) - assert(2, attachments_inline.count) + assert_equal(2, attachments_inline.count) assert_equal('image1.jpeg', attachments_inline[0][:filename]) assert_equal('image/jpeg', attachments_inline[0][:preferences]['Content-Type']) assert_match(/@#{Setting.get('fqdn')}/, attachments_inline[0][:preferences]['Content-ID'])