Resourcified repositories for CRUD operations to prepare for multiple SCM per project (#779).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8648 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-01-15 14:23:06 +00:00
parent 6f462d373f
commit fb1a2fd7cd
68 changed files with 393 additions and 227 deletions

View File

@@ -24,19 +24,47 @@ class RoutingRepositoriesTest < ActionController::IntegrationTest
assert_equal %w[path to file.c], @path_hash[:param]
end
def test_repositories_resources
assert_routing(
{ :method => 'get',
:path => "/projects/redmine/repositories/new" },
{ :controller => 'repositories', :action => 'new', :project_id => 'redmine' }
)
assert_routing(
{ :method => 'post',
:path => "/projects/redmine/repositories" },
{ :controller => 'repositories', :action => 'create', :project_id => 'redmine' }
)
assert_routing(
{ :method => 'get',
:path => "/repositories/1/edit" },
{ :controller => 'repositories', :action => 'edit', :id => '1' }
)
assert_routing(
{ :method => 'put',
:path => "/repositories/1" },
{ :controller => 'repositories', :action => 'update', :id => '1' }
)
assert_routing(
{ :method => 'delete',
:path => "/repositories/1" },
{ :controller => 'repositories', :action => 'destroy', :id => '1' }
)
["get", "post"].each do |method|
assert_routing(
{ :method => method,
:path => "/repositories/1/committers" },
{ :controller => 'repositories', :action => 'committers', :id => '1' }
)
end
end
def test_repositories
assert_routing(
{ :method => 'get',
:path => "/projects/redmine/repository" },
{ :controller => 'repositories', :action => 'show', :id => 'redmine' }
)
["get", "post"].each do |method|
assert_routing(
{ :method => method,
:path => "/projects/redmine/repository/edit" },
{ :controller => 'repositories', :action => 'edit', :id => 'redmine' }
)
end
assert_routing(
{ :method => 'get',
:path => "/projects/redmine/repository/statistics" },