test: route: repositories: add show, changes and annotate actions in revisions scope

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8517 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2012-01-05 10:17:15 +00:00
parent e97db2589d
commit 93a0daa383
1 changed files with 31 additions and 0 deletions

View File

@ -45,6 +45,7 @@ class RoutingRepositoriesTest < ActionController::IntegrationTest
end end
def test_repositories_revisions def test_repositories_revisions
empty_path_param = []
assert_routing( assert_routing(
{ :method => 'get', { :method => 'get',
:path => "/projects/redmine/repository/revisions" }, :path => "/projects/redmine/repository/revisions" },
@ -62,6 +63,30 @@ class RoutingRepositoriesTest < ActionController::IntegrationTest
{ :controller => 'repositories', :action => 'revision', :id => 'redmine', { :controller => 'repositories', :action => 'revision', :id => 'redmine',
:rev => '2457' } :rev => '2457' }
) )
assert_routing(
{ :method => 'get',
:path => "/projects/redmine/repository/revisions/2457/show" },
{ :controller => 'repositories', :action => 'show', :id => 'redmine',
:path => empty_path_param, :rev => '2457' }
)
assert_routing(
{ :method => 'get',
:path => "/projects/redmine/repository/revisions/2457/show/#{@path_hash[:path]}" },
{ :controller => 'repositories', :action => 'show', :id => 'redmine',
:path => @path_hash[:param] , :rev => '2457'}
)
assert_routing(
{ :method => 'get',
:path => "/projects/redmine/repository/revisions/2457/changes" },
{ :controller => 'repositories', :action => 'changes', :id => 'redmine',
:path => empty_path_param, :rev => '2457' }
)
assert_routing(
{ :method => 'get',
:path => "/projects/redmine/repository/revisions/2457/changes/#{@path_hash[:path]}" },
{ :controller => 'repositories', :action => 'changes', :id => 'redmine',
:path => @path_hash[:param] , :rev => '2457'}
)
assert_routing( assert_routing(
{ :method => 'get', { :method => 'get',
:path => "/projects/redmine/repository/revisions/2457/diff" }, :path => "/projects/redmine/repository/revisions/2457/diff" },
@ -92,6 +117,12 @@ class RoutingRepositoriesTest < ActionController::IntegrationTest
{ :controller => 'repositories', :action => 'entry', :id => 'redmine', { :controller => 'repositories', :action => 'entry', :id => 'redmine',
:path => @path_hash[:param], :rev => '2', :format => 'raw' } :path => @path_hash[:param], :rev => '2', :format => 'raw' }
) )
assert_routing(
{ :method => 'get',
:path => "/projects/redmine/repository/revisions/2/annotate/#{@path_hash[:path]}" },
{ :controller => 'repositories', :action => 'annotate', :id => 'redmine',
:path => @path_hash[:param], :rev => '2' }
)
end end
def test_repositories_non_revisions_path def test_repositories_non_revisions_path