1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-19 15:01:14 +00:00

Add tests for r18383 (#31231).

Patch by Mizuki ISHIKAWA.


git-svn-id: http://svn.redmine.org/redmine/trunk@18384 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA 2019-08-24 07:03:01 +00:00
parent d50f0e83fb
commit 878f4c3455
3 changed files with 28 additions and 0 deletions

View File

@ -46,4 +46,22 @@ class Redmine::WikiFormatting::HtmlParserTest < ActiveSupport::TestCase
assert_equal expected, @parser.to_text(html) assert_equal expected, @parser.to_text(html)
end end
end end
def test_should_remove_space_of_beginning_of_line
str = <<~HTML
<table>
<tr>
<th>th1</th>
<th>th2</th>
</tr>
<tr>
<td>td1</td>
<td>td2</td>
</tr>
</table>
HTML
assert_equal "th1\n\nth2\n\ntd1\n\ntd2",
@parser.to_text(str)
end
end end

View File

@ -34,4 +34,9 @@ class Redmine::WikiFormatting::MarkdownHtmlParserTest < ActiveSupport::TestCase
assert_equal 'foo http://example.com/ baz', assert_equal 'foo http://example.com/ baz',
@parser.to_text('foo<a href="http://example.com/"></a>baz') @parser.to_text('foo<a href="http://example.com/"></a>baz')
end end
def test_html_tables_conversion
assert_equal "*th1*\n*th2*\n\ntd1\ntd2",
@parser.to_text('<table><tr><th>th1</th><th>th2</th></tr><tr><td>td1</td><td>td2</td></tr></table>')
end
end end

View File

@ -34,4 +34,9 @@ class Redmine::WikiFormatting::TextileHtmlParserTest < ActiveSupport::TestCase
assert_equal 'foo http://example.com/ baz', assert_equal 'foo http://example.com/ baz',
@parser.to_text('foo<a href="http://example.com/"></a>baz') @parser.to_text('foo<a href="http://example.com/"></a>baz')
end end
def test_html_tables_conversion
assert_equal "*th1*\n*th2*\n\ntd1\ntd2",
@parser.to_text('<table><tr><th>th1</th><th>th2</th></tr><tr><td>td1</td><td>td2</td></tr></table>')
end
end end