test: route: split repository route test

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8404 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-12-27 12:11:51 +00:00
parent ac51ab12f0
commit 6178780a3d
1 changed files with 24 additions and 18 deletions

View File

@ -29,6 +29,9 @@ class RoutingRepositoriesTest < ActionController::IntegrationTest
:path => "/projects/redmine/repository/edit" }, :path => "/projects/redmine/repository/edit" },
{ :controller => 'repositories', :action => 'edit', :id => 'redmine' } { :controller => 'repositories', :action => 'edit', :id => 'redmine' }
) )
end
def test_repositories_revisions
assert_routing( assert_routing(
{ :method => 'get', { :method => 'get',
:path => "/projects/redmine/repository/revisions" }, :path => "/projects/redmine/repository/revisions" },
@ -58,18 +61,33 @@ class RoutingRepositoriesTest < ActionController::IntegrationTest
{ :controller => 'repositories', :action => 'diff', :id => 'redmine', { :controller => 'repositories', :action => 'diff', :id => 'redmine',
:rev => '2457', :format => 'diff' } :rev => '2457', :format => 'diff' }
) )
assert_routing(
{ :method => 'get',
:path => "/projects/redmine/repository/diff/path/to/file.c" },
{ :controller => 'repositories', :action => 'diff', :id => 'redmine',
:path => %w[path to file.c] }
)
assert_routing( assert_routing(
{ :method => 'get', { :method => 'get',
:path => "/projects/redmine/repository/revisions/2/diff/path/to/file.c" }, :path => "/projects/redmine/repository/revisions/2/diff/path/to/file.c" },
{ :controller => 'repositories', :action => 'diff', :id => 'redmine', { :controller => 'repositories', :action => 'diff', :id => 'redmine',
:path => %w[path to file.c], :rev => '2' } :path => %w[path to file.c], :rev => '2' }
) )
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' }
)
assert_routing(
{ :method => 'get',
: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/diff/path/to/file.c" },
{ :controller => 'repositories', :action => 'diff', :id => 'redmine',
:path => %w[path to file.c] }
)
assert_routing( assert_routing(
{ :method => 'get', { :method => 'get',
:path => "/projects/redmine/repository/browse/path/to/file.c" }, :path => "/projects/redmine/repository/browse/path/to/file.c" },
@ -82,24 +100,12 @@ class RoutingRepositoriesTest < ActionController::IntegrationTest
{ :controller => 'repositories', :action => 'entry', :id => 'redmine', { :controller => 'repositories', :action => 'entry', :id => 'redmine',
:path => %w[path to file.c] } :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' }
)
assert_routing( assert_routing(
{ :method => 'get', { :method => 'get',
:path => "/projects/redmine/repository/raw/path/to/file.c" }, :path => "/projects/redmine/repository/raw/path/to/file.c" },
{ :controller => 'repositories', :action => 'entry', :id => 'redmine', { :controller => 'repositories', :action => 'entry', :id => 'redmine',
:path => %w[path to file.c], :format => 'raw' } :path => %w[path to file.c], :format => 'raw' }
) )
assert_routing(
{ :method => 'get',
: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' }
)
assert_routing( assert_routing(
{ :method => 'get', { :method => 'get',
:path => "/projects/redmine/repository/annotate/path/to/file.c" }, :path => "/projects/redmine/repository/annotate/path/to/file.c" },