diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-07-19 14:23:15 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-07-19 14:23:15 +0000 |
commit | dcba9f18e6f3a19af85bb66843eb97107805bb75 (patch) | |
tree | 4c0dcb8d7a46ee17dfe4b28a820f46eb37a18eca /test/unit | |
parent | 5ec4d4cdab31509ff7afa5a9415850885885a6c4 (diff) | |
download | redmine-dcba9f18e6f3a19af85bb66843eb97107805bb75.tar.gz redmine-dcba9f18e6f3a19af85bb66843eb97107805bb75.zip |
Allow line breaks in wiki table cells (#2346).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2824 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/helpers/application_helper_test.rb | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index 4d7719567..2dc506702 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -109,7 +109,7 @@ class ApplicationHelperTest < HelperTestCase '"link (Link title with "double-quotes")":http://foo.bar' => '<a href="http://foo.bar" title="Link title with "double-quotes"" class="external">link</a>', "This is not a \"Link\":\n\nAnother paragraph" => "This is not a \"Link\":</p>\n\n\n\t<p>Another paragraph", # no multiline link text - "This is a double quote \"on the first line\nand another on a second line\":test" => "This is a double quote \"on the first line<br />\nand another on a second line\":test", + "This is a double quote \"on the first line\nand another on a second line\":test" => "This is a double quote \"on the first line<br />and another on a second line\":test", # mailto link "\"system administrator\":mailto:sysadmin@example.com?subject=redmine%20permissions" => "<a href=\"mailto:sysadmin@example.com?subject=redmine%20permissions\">system administrator</a>", # two exclamation marks @@ -396,6 +396,45 @@ EXPECTED assert_equal expected.gsub(%r{\s+}, ''), textilizable(raw).gsub(%r{\s+}, '') end + def test_table_with_line_breaks + raw = <<-RAW +This is a table with line breaks: + +|cell11 +continued|cell12|| +|-cell21-||cell23 +cell23 line2 +cell23 *line3*| +|cell31|cell32 +cell32 line2|cell33| + +RAW + + expected = <<-EXPECTED +<p>This is a table with line breaks:</p> + +<table> + <tr> + <td>cell11<br />continued</td> + <td>cell12</td> + <td></td> + </tr> + <tr> + <td><del>cell21</del></td> + <td></td> + <td>cell23<br/>cell23 line2<br/>cell23 <strong>line3</strong></td> + </tr> + <tr> + <td>cell31</td> + <td>cell32<br/>cell32 line2</td> + <td>cell33</td> + </tr> +</table> +EXPECTED + + assert_equal expected.gsub(%r{\s+}, ''), textilizable(raw).gsub(%r{\s+}, '') + end + def test_default_formatter Setting.text_formatting = 'unknown' text = 'a *link*: http://www.example.net/' |