Isolates all API routing tests to a specific test case.

git-svn-id: http://svn.redmine.org/redmine/trunk@13604 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2014-11-16 10:54:33 +00:00
parent cd6b2f2268
commit eae9c9ab2b
22 changed files with 207 additions and 438 deletions

View File

@@ -23,18 +23,10 @@ class RoutingGroupsTest < ActionDispatch::IntegrationTest
{ :method => 'get', :path => "/groups" },
{ :controller => 'groups', :action => 'index' }
)
assert_routing(
{ :method => 'get', :path => "/groups.xml" },
{ :controller => 'groups', :action => 'index', :format => 'xml' }
)
assert_routing(
{ :method => 'post', :path => "/groups" },
{ :controller => 'groups', :action => 'create' }
)
assert_routing(
{ :method => 'post', :path => "/groups.xml" },
{ :controller => 'groups', :action => 'create', :format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/groups/new" },
{ :controller => 'groups', :action => 'new' }
@@ -55,26 +47,14 @@ class RoutingGroupsTest < ActionDispatch::IntegrationTest
{ :method => 'get', :path => "/groups/1" },
{ :controller => 'groups', :action => 'show', :id => '1' }
)
assert_routing(
{ :method => 'get', :path => "/groups/1.xml" },
{ :controller => 'groups', :action => 'show', :id => '1', :format => 'xml' }
)
assert_routing(
{ :method => 'put', :path => "/groups/1" },
{ :controller => 'groups', :action => 'update', :id => '1' }
)
assert_routing(
{ :method => 'put', :path => "/groups/1.xml" },
{ :controller => 'groups', :action => 'update', :id => '1', :format => 'xml' }
)
assert_routing(
{ :method => 'delete', :path => "/groups/1" },
{ :controller => 'groups', :action => 'destroy', :id => '1' }
)
assert_routing(
{ :method => 'delete', :path => "/groups/1.xml" },
{ :controller => 'groups', :action => 'destroy', :id => '1', :format => 'xml' }
)
end
def test_groups
@@ -86,17 +66,9 @@ class RoutingGroupsTest < ActionDispatch::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' }
)
assert_routing(
{ :method => 'delete', :path => "/groups/567/users/12.xml" },
{ :controller => 'groups', :action => 'remove_user', :id => '567', :user_id => '12', :format => 'xml' }
)
end
end