diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-01-23 16:12:38 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-01-23 16:12:38 +0000 |
commit | 777ccf1328c9ebfac33f23e965eccfb5578f182f (patch) | |
tree | b975f2dc8a60fd2382b264dfc51662886f88305c /test/unit/helpers | |
parent | 507f9d753f56c0530bd7411c4de1bc3835c03321 (diff) | |
download | redmine-777ccf1328c9ebfac33f23e965eccfb5578f182f.tar.gz redmine-777ccf1328c9ebfac33f23e965eccfb5578f182f.zip |
Adds support for cross project Redmine links (#7409).
See public/help/wiki_syntax_detailed.html for the syntax.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4758 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/helpers')
-rw-r--r-- | test/unit/helpers/application_helper_test.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index c8235adaf..9232b1b8d 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -224,6 +224,35 @@ RAW @project = Project.find(1) to_test.each { |text, result| assert_equal "<p>#{result}</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') + + changeset_link = link_to('ecookbook:r2', {:controller => 'repositories', :action => 'revision', :id => 'ecookbook', :rev => 2}, + :class => 'changeset', :title => 'This commit fixes #1, #2 and references #1 & #3') + + to_test = { + # documents + 'document:"Test document"' => 'document:"Test document"', + 'ecookbook:document:"Test document"' => '<a href="/documents/1" class="document">Test document</a>', + 'invalid:document:"Test document"' => 'invalid:document:"Test document"', + # versions + 'version:"1.0"' => 'version:"1.0"', + 'ecookbook:version:"1.0"' => '<a href="/versions/show/2" class="version">1.0</a>', + 'invalid:version:"1.0"' => 'invalid:version:"1.0"', + # changeset + 'r2' => 'r2', + 'ecookbook:r2' => changeset_link, + 'invalid:r2' => 'invalid:r2', + # source + 'source:/some/file' => 'source:/some/file', + 'ecookbook:source:/some/file' => source_link, + 'invalid:source:/some/file' => 'invalid:source:/some/file', + } + @project = Project.find(3) + to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text), "#{text} failed" } + end def test_redmine_links_git_commit changeset_link = link_to('abcd', |