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
This commit is contained in:
Jean-Philippe Lang 2012-02-15 17:59:13 +00:00
parent 5c3ac1a40e
commit 3c75601976
1 changed files with 17 additions and 11 deletions

View File

@ -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')