From: Go MAEDA Date: Sat, 24 Aug 2019 07:03:01 +0000 (+0000) Subject: Add tests for r18383 (#31231). X-Git-Tag: 4.1.0~688 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=878f4c3455141a26d7070fb0efac1cd89243c3bb;p=redmine.git Add tests for r18383 (#31231). Patch by Mizuki ISHIKAWA. git-svn-id: http://svn.redmine.org/redmine/trunk@18384 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/test/unit/lib/redmine/wiki_formatting/html_parser_test.rb b/test/unit/lib/redmine/wiki_formatting/html_parser_test.rb index 210bba832..3d931bb3c 100644 --- a/test/unit/lib/redmine/wiki_formatting/html_parser_test.rb +++ b/test/unit/lib/redmine/wiki_formatting/html_parser_test.rb @@ -46,4 +46,22 @@ class Redmine::WikiFormatting::HtmlParserTest < ActiveSupport::TestCase assert_equal expected, @parser.to_text(html) end end + + def test_should_remove_space_of_beginning_of_line + str = <<~HTML + + + + + + + + + +
th1th2
td1td2
+ HTML + + assert_equal "th1\n\nth2\n\ntd1\n\ntd2", + @parser.to_text(str) + end end diff --git a/test/unit/lib/redmine/wiki_formatting/markdown_html_parser_test.rb b/test/unit/lib/redmine/wiki_formatting/markdown_html_parser_test.rb index 6a4b77387..45a5a52f9 100644 --- a/test/unit/lib/redmine/wiki_formatting/markdown_html_parser_test.rb +++ b/test/unit/lib/redmine/wiki_formatting/markdown_html_parser_test.rb @@ -34,4 +34,9 @@ class Redmine::WikiFormatting::MarkdownHtmlParserTest < ActiveSupport::TestCase assert_equal 'foo http://example.com/ baz', @parser.to_text('foobaz') end + + def test_html_tables_conversion + assert_equal "*th1*\n*th2*\n\ntd1\ntd2", + @parser.to_text('
th1th2
td1td2
') + end end diff --git a/test/unit/lib/redmine/wiki_formatting/textile_html_parser_test.rb b/test/unit/lib/redmine/wiki_formatting/textile_html_parser_test.rb index a338ed528..86d7e66d2 100644 --- a/test/unit/lib/redmine/wiki_formatting/textile_html_parser_test.rb +++ b/test/unit/lib/redmine/wiki_formatting/textile_html_parser_test.rb @@ -34,4 +34,9 @@ class Redmine::WikiFormatting::TextileHtmlParserTest < ActiveSupport::TestCase assert_equal 'foo http://example.com/ baz', @parser.to_text('foobaz') end + + def test_html_tables_conversion + assert_equal "*th1*\n*th2*\n\ntd1\ntd2", + @parser.to_text('
th1th2
td1td2
') + end end