Project

General

Profile

Feature #31231 » add-tests.patch

Mizuki ISHIKAWA, 2019-05-24 08:02

View differences:

test/unit/lib/redmine/wiki_formatting/html_parser_test.rb
assert_equal "Text",
@parser.to_text('<html><body><style>body {font-size: 0.8em;}</style>Text</body></html>')
end
def test_should_remove_space_of_beginning_of_line
str = <<~EOS
<table>
<tr>
<th>th1</th>
<th>th2</th>
</tr>
<tr>
<td>td1</td>
<td>td2</td>
</tr>
</table>
EOS
assert_equal "th1\n\nth2\n\ntd1\n\ntd2",
@parser.to_text(str)
end
end
test/unit/lib/redmine/wiki_formatting/markdown_html_parser_test.rb
assert_equal 'A **simple** html snippet.',
@parser.to_text('<p>A <b>simple</b> html snippet.</p>')
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
test/unit/lib/redmine/wiki_formatting/textile_html_parser_test.rb
assert_equal 'A *simple* html snippet.',
@parser.to_text('<p>A <b>simple</b> html snippet.</p>')
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
(2-2/3)