summaryrefslogtreecommitdiffstats
path: root/test/unit/helpers/application_helper_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-26 03:13:34 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-26 03:13:34 +0000
commitd02e5e54a82508ce71c211b48d662a155787fa4a (patch)
tree0a34bb6fc16a65cce7e4977e702783f43862ecad /test/unit/helpers/application_helper_test.rb
parentc050028102247e0981966f89b5f291122361abce (diff)
downloadredmine-d02e5e54a82508ce71c211b48d662a155787fa4a.tar.gz
redmine-d02e5e54a82508ce71c211b48d662a155787fa4a.zip
Merged r10580 and r10581 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.1-stable@10722 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/helpers/application_helper_test.rb')
-rw-r--r--test/unit/helpers/application_helper_test.rb27
1 files changed, 19 insertions, 8 deletions
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb
index c431e2612..9855efa27 100644
--- a/test/unit/helpers/application_helper_test.rb
+++ b/test/unit/helpers/application_helper_test.rb
@@ -253,8 +253,15 @@ RAW
project_url = {:controller => 'projects', :action => 'show', :id => 'subproject1'}
- source_url = {:controller => 'repositories', :action => 'entry', :id => 'ecookbook', :path => ['some', 'file']}
- source_url_with_ext = {:controller => 'repositories', :action => 'entry', :id => 'ecookbook', :path => ['some', 'file.ext']}
+ source_url = '/projects/ecookbook/repository/entry/some/file'
+ source_url_with_rev = '/projects/ecookbook/repository/revisions/52/entry/some/file'
+ source_url_with_ext = '/projects/ecookbook/repository/entry/some/file.ext'
+ source_url_with_rev_and_ext = '/projects/ecookbook/repository/revisions/52/entry/some/file.ext'
+
+ export_url = '/projects/ecookbook/repository/raw/some/file'
+ export_url_with_rev = '/projects/ecookbook/repository/revisions/52/raw/some/file'
+ export_url_with_ext = '/projects/ecookbook/repository/raw/some/file.ext'
+ export_url_with_rev_and_ext = '/projects/ecookbook/repository/revisions/52/raw/some/file.ext'
to_test = {
# tickets
@@ -284,12 +291,16 @@ RAW
'source:/some/file. ' => link_to('source:/some/file', source_url, :class => 'source') + ".",
'source:/some/file.ext. ' => link_to('source:/some/file.ext', source_url_with_ext, :class => 'source') + ".",
'source:/some/file, ' => link_to('source:/some/file', source_url, :class => 'source') + ",",
- 'source:/some/file@52' => link_to('source:/some/file@52', source_url.merge(:rev => 52), :class => 'source'),
- 'source:/some/file.ext@52' => link_to('source:/some/file.ext@52', source_url_with_ext.merge(:rev => 52), :class => 'source'),
- 'source:/some/file#L110' => link_to('source:/some/file#L110', source_url.merge(:anchor => 'L110'), :class => 'source'),
- 'source:/some/file.ext#L110' => link_to('source:/some/file.ext#L110', source_url_with_ext.merge(:anchor => 'L110'), :class => 'source'),
- 'source:/some/file@52#L110' => link_to('source:/some/file@52#L110', source_url.merge(:rev => 52, :anchor => 'L110'), :class => 'source'),
- 'export:/some/file' => link_to('export:/some/file', source_url.merge(:format => 'raw'), :class => 'source download'),
+ 'source:/some/file@52' => link_to('source:/some/file@52', source_url_with_rev, :class => 'source'),
+ 'source:/some/file.ext@52' => link_to('source:/some/file.ext@52', source_url_with_rev_and_ext, :class => 'source'),
+ 'source:/some/file#L110' => link_to('source:/some/file#L110', source_url + "#L110", :class => 'source'),
+ 'source:/some/file.ext#L110' => link_to('source:/some/file.ext#L110', source_url_with_ext + "#L110", :class => 'source'),
+ 'source:/some/file@52#L110' => link_to('source:/some/file@52#L110', source_url_with_rev + "#L110", :class => 'source'),
+ # export
+ 'export:/some/file' => link_to('export:/some/file', export_url, :class => 'source download'),
+ 'export:/some/file.ext' => link_to('export:/some/file.ext', export_url_with_ext, :class => 'source download'),
+ 'export:/some/file@52' => link_to('export:/some/file@52', export_url_with_rev, :class => 'source download'),
+ 'export:/some/file.ext@52' => link_to('export:/some/file.ext@52', export_url_with_rev_and_ext, :class => 'source download'),
# forum
'forum#2' => link_to('Discussion', board_url, :class => 'board'),
'forum:Discussion' => link_to('Discussion', board_url, :class => 'board'),