summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-15 17:59:13 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-15 17:59:13 +0000
commit3c756019765044ff2c6f667d1518bfab7f4f2cb7 (patch)
tree88482bc506efc105ec98c143d0ae29605045108d /test
parent5c3ac1a40e123688048268d22d553080ee001254 (diff)
downloadredmine-3c756019765044ff2c6f667d1518bfab7f4f2cb7.tar.gz
redmine-3c756019765044ff2c6f667d1518bfab7f4f2cb7.zip
Moved redmine links escaping assertions to their own test.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8878 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/helpers/application_helper_test.rb28
1 files changed, 17 insertions, 11 deletions
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb
index 12776d58c..2fcb0309c 100644
--- a/test/unit/helpers/application_helper_test.rb
+++ b/test/unit/helpers/application_helper_test.rb
@@ -297,17 +297,6 @@ RAW
'project#3' => link_to('eCookbook Subproject 1', project_url, :class => 'project'),
'project:subproject1' => link_to('eCookbook Subproject 1', project_url, :class => 'project'),
'project:"eCookbook subProject 1"' => link_to('eCookbook Subproject 1', project_url, :class => 'project'),
- # escaping
- '!#3.' => '#3.',
- '!#3-14.' => '#3-14.',
- '!#3#-note14.' => '#3#-note14.',
- '!r1' => 'r1',
- '!document#1' => 'document#1',
- '!document:"Test document"' => 'document:"Test document"',
- '!version#2' => 'version#2',
- '!version:1.0' => 'version:1.0',
- '!version:"1.0"' => 'version:"1.0"',
- '!source:/some/file' => 'source:/some/file',
# not found
'#0123456789' => '#0123456789',
# invalid expressions
@@ -319,6 +308,23 @@ RAW
to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text), "#{text} failed" }
end
+ def test_escaped_redmine_links_should_not_be_parsed
+ to_test = [
+ '#3.',
+ '#3-14.',
+ '#3#-note14.',
+ 'r1',
+ 'document#1',
+ 'document:"Test document"',
+ 'version#2',
+ 'version:1.0',
+ 'version:"1.0"',
+ 'source:/some/file'
+ ]
+ @project = Project.find(1)
+ to_test.each { |text| assert_equal "<p>#{text}</p>", textilizable("!" + text), "#{text} failed" }
+ end
+
def test_cross_project_redmine_links
source_link = link_to('ecookbook:source:/some/file', {:controller => 'repositories', :action => 'entry', :id => 'ecookbook', :path => ['some', 'file']},
:class => 'source')