diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-01-11 16:03:24 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-01-11 16:03:24 +0000 |
commit | f17e1ce368c9a90bf30012c7dae5f69891cc1438 (patch) | |
tree | c6a5d3a567ac398b6cd8db32059a6dff8180c1aa | |
parent | d67185ec7e1aad57954633b70d71fc4c6a0ba58e (diff) | |
download | redmine-f17e1ce368c9a90bf30012c7dae5f69891cc1438.tar.gz redmine-f17e1ce368c9a90bf30012c7dae5f69891cc1438.zip |
scm: mercurial: add "commit:xxx" and "rNN" link test for mercurial (#3724).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4696 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | test/unit/helpers/application_helper_test.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index 5e42762fd..c8235adaf 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -274,6 +274,39 @@ RAW to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) } end + def test_redmine_links_mercurial_commit + changeset_link_rev = link_to('r123', + { + :controller => 'repositories', + :action => 'revision', + :id => 'subproject1', + :rev => '123' , + }, + :class => 'changeset', :title => 'test commit') + changeset_link_commit = link_to('abcd', + { + :controller => 'repositories', + :action => 'revision', + :id => 'subproject1', + :rev => 'abcd' , + }, + :class => 'changeset', :title => 'test commit') + to_test = { + 'r123' => changeset_link_rev, + 'commit:abcd' => changeset_link_commit, + } + @project = Project.find(3) + r = Repository::Mercurial.create!(:project => @project, :url => '/tmp/test') + assert r + c = Changeset.new(:repository => r, + :committed_on => Time.now, + :revision => '123', + :scmid => 'abcd', + :comments => 'test commit') + assert( c.save ) + to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) } + end + def test_attachment_links attachment_link = link_to('error281.txt', {:controller => 'attachments', :action => 'download', :id => '1'}, :class => 'attachment') to_test = { |