REST Api for Groups (#8981).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9758 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-06-03 10:40:32 +00:00
parent 3142183b30
commit dd9c2cafa7
8 changed files with 294 additions and 39 deletions

View File

@@ -39,48 +39,37 @@ class RoutingGroupsTest < ActionController::IntegrationTest
{ :method => 'get', :path => "/groups/new" },
{ :controller => 'groups', :action => 'new' }
)
assert_routing(
{ :method => 'get', :path => "/groups/new.xml" },
{ :controller => 'groups', :action => 'new', :format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/groups/1/edit" },
{ :controller => 'groups', :action => 'edit', :id => '1' }
)
assert_routing(
{ :method => 'get', :path => "/groups/1/autocomplete_for_user" },
{ :controller => 'groups', :action => 'autocomplete_for_user',
:id => '1' }
{ :controller => 'groups', :action => 'autocomplete_for_user', :id => '1' }
)
assert_routing(
{ :method => 'get', :path => "/groups/1" },
{ :controller => 'groups', :action => 'show',
:id => '1' }
{ :controller => 'groups', :action => 'show', :id => '1' }
)
assert_routing(
{ :method => 'get', :path => "/groups/1.xml" },
{ :controller => 'groups', :action => 'show',
:format => 'xml', :id => '1' }
{ :controller => 'groups', :action => 'show', :id => '1', :format => 'xml' }
)
assert_routing(
{ :method => 'put', :path => "/groups/1" },
{ :controller => 'groups', :action => 'update',
:id => '1' }
{ :controller => 'groups', :action => 'update', :id => '1' }
)
assert_routing(
{ :method => 'put', :path => "/groups/1.xml" },
{ :controller => 'groups', :action => 'update',
:format => 'xml', :id => '1' }
{ :controller => 'groups', :action => 'update', :id => '1', :format => 'xml' }
)
assert_routing(
{ :method => 'delete', :path => "/groups/1" },
{ :controller => 'groups', :action => 'destroy',
:id => '1' }
{ :controller => 'groups', :action => 'destroy', :id => '1' }
)
assert_routing(
{ :method => 'delete', :path => "/groups/1.xml" },
{ :controller => 'groups', :action => 'destroy',
:format => 'xml', :id => '1' }
{ :controller => 'groups', :action => 'destroy', :id => '1', :format => 'xml' }
)
end
@@ -89,10 +78,17 @@ class RoutingGroupsTest < ActionController::IntegrationTest
{ :method => 'post', :path => "/groups/567/users" },
{ :controller => 'groups', :action => 'add_users', :id => '567' }
)
assert_routing(
{ :method => 'post', :path => "/groups/567/users.xml" },
{ :controller => 'groups', :action => 'add_users', :id => '567', :format => 'xml' }
)
assert_routing(
{ :method => 'delete', :path => "/groups/567/users/12" },
{ :controller => 'groups', :action => 'remove_user', :id => '567',
:user_id => '12' }
{ :controller => 'groups', :action => 'remove_user', :id => '567', :user_id => '12' }
)
assert_routing(
{ :method => 'delete', :path => "/groups/567/users/12.xml" },
{ :controller => 'groups', :action => 'remove_user', :id => '567', :user_id => '12', :format => 'xml' }
)
assert_routing(
{ :method => 'post', :path => "/groups/destroy_membership/567" },