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:
parent
d50f0e83fb
commit
878f4c3455
@ -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
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user