summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-11-24 14:20:01 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-11-24 14:20:01 +0000
commitfb9a2901e969548a2859b2875e1684a0e21362f6 (patch)
tree1d9115b0c73ac3f2640856587991260677f3a192 /test
parentb94c971755ec0de932cb55ed5b813bbb033b6141 (diff)
downloadredmine-fb9a2901e969548a2859b2875e1684a0e21362f6.tar.gz
redmine-fb9a2901e969548a2859b2875e1684a0e21362f6.zip
Fixed that autolinks and textile links ending with cyrilic characters are broken (#12397).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10879 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/helpers/application_helper_test.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb
index 6d5021ed5..d44dba8a2 100644
--- a/test/unit/helpers/application_helper_test.rb
+++ b/test/unit/helpers/application_helper_test.rb
@@ -88,6 +88,17 @@ class ApplicationHelperTest < ActionView::TestCase
to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) }
end
+ if 'ruby'.respond_to?(:encoding)
+ def test_auto_links_with_non_ascii_characters
+ to_test = {
+ 'http://foo.bar/тест' => '<a class="external" href="http://foo.bar/тест">http://foo.bar/тест</a>'
+ }
+ to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) }
+ end
+ else
+ puts 'Skipping test_auto_links_with_non_ascii_characters, unsupported ruby version'
+ end
+
def test_auto_mailto
assert_equal '<p><a class="email" href="mailto:test@foo.bar">test@foo.bar</a></p>',
textilizable('test@foo.bar')
@@ -228,6 +239,17 @@ RAW
to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) }
end
+ if 'ruby'.respond_to?(:encoding)
+ def test_textile_external_links_with_non_ascii_characters
+ to_test = {
+ 'This is a "link":http://foo.bar/тест' => 'This is a <a href="http://foo.bar/тест" class="external">link</a>'
+ }
+ to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) }
+ end
+ else
+ puts 'Skipping test_textile_external_links_with_non_ascii_characters, unsupported ruby version'
+ end
+
def test_redmine_links
issue_link = link_to('#3', {:controller => 'issues', :action => 'show', :id => 3},
:class => 'issue status-1 priority-4 priority-lowest overdue', :title => 'Error 281 when updating a recipe (New)')