diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-12-27 12:11:51 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-12-27 12:11:51 +0000 |
commit | 6178780a3d8026eb7cd339092dafbeef201840f3 (patch) | |
tree | da6f96f765ba4c377e63a9a9834b4516a4ddc607 /test | |
parent | ac51ab12f08a8877861a1fc0bf69b73f48a4b44e (diff) | |
download | redmine-6178780a3d8026eb7cd339092dafbeef201840f3.tar.gz redmine-6178780a3d8026eb7cd339092dafbeef201840f3.zip |
test: route: split repository route test
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8404 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/integration/routing/repositories_test.rb | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/test/integration/routing/repositories_test.rb b/test/integration/routing/repositories_test.rb index 3de354b57..6378fd0bc 100644 --- a/test/integration/routing/repositories_test.rb +++ b/test/integration/routing/repositories_test.rb @@ -29,6 +29,9 @@ class RoutingRepositoriesTest < ActionController::IntegrationTest :path => "/projects/redmine/repository/edit" }, { :controller => 'repositories', :action => 'edit', :id => 'redmine' } ) + end + + def test_repositories_revisions assert_routing( { :method => 'get', :path => "/projects/redmine/repository/revisions" }, @@ -60,45 +63,48 @@ class RoutingRepositoriesTest < ActionController::IntegrationTest ) assert_routing( { :method => 'get', - :path => "/projects/redmine/repository/diff/path/to/file.c" }, + :path => "/projects/redmine/repository/revisions/2/diff/path/to/file.c" }, { :controller => 'repositories', :action => 'diff', :id => 'redmine', - :path => %w[path to file.c] } + :path => %w[path to file.c], :rev => '2' } ) assert_routing( { :method => 'get', - :path => "/projects/redmine/repository/revisions/2/diff/path/to/file.c" }, - { :controller => 'repositories', :action => 'diff', :id => 'redmine', + :path => "/projects/redmine/repository/revisions/2/entry/path/to/file.c" }, + { :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :rev => '2' } ) assert_routing( { :method => 'get', - :path => "/projects/redmine/repository/browse/path/to/file.c" }, - { :controller => 'repositories', :action => 'browse', :id => 'redmine', - :path => %w[path to file.c] } + :path => "/projects/redmine/repository/revisions/2/raw/path/to/file.c" }, + { :controller => 'repositories', :action => 'entry', :id => 'redmine', + :path => %w[path to file.c], :rev => '2', :format => 'raw' } ) + end + + def test_repositories_etc assert_routing( { :method => 'get', - :path => "/projects/redmine/repository/entry/path/to/file.c" }, - { :controller => 'repositories', :action => 'entry', :id => 'redmine', + :path => "/projects/redmine/repository/diff/path/to/file.c" }, + { :controller => 'repositories', :action => 'diff', :id => 'redmine', :path => %w[path to file.c] } ) assert_routing( { :method => 'get', - :path => "/projects/redmine/repository/revisions/2/entry/path/to/file.c" }, - { :controller => 'repositories', :action => 'entry', :id => 'redmine', - :path => %w[path to file.c], :rev => '2' } + :path => "/projects/redmine/repository/browse/path/to/file.c" }, + { :controller => 'repositories', :action => 'browse', :id => 'redmine', + :path => %w[path to file.c] } ) assert_routing( { :method => 'get', - :path => "/projects/redmine/repository/raw/path/to/file.c" }, + :path => "/projects/redmine/repository/entry/path/to/file.c" }, { :controller => 'repositories', :action => 'entry', :id => 'redmine', - :path => %w[path to file.c], :format => 'raw' } + :path => %w[path to file.c] } ) assert_routing( { :method => 'get', - :path => "/projects/redmine/repository/revisions/2/raw/path/to/file.c" }, + :path => "/projects/redmine/repository/raw/path/to/file.c" }, { :controller => 'repositories', :action => 'entry', :id => 'redmine', - :path => %w[path to file.c], :rev => '2', :format => 'raw' } + :path => %w[path to file.c], :format => 'raw' } ) assert_routing( { :method => 'get', |