diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-11-16 14:23:32 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-11-16 14:23:32 +0000 |
commit | ecda1c7a4f30354db74e73eade71550074f67356 (patch) | |
tree | 6f57fba84094ff87a171b05ef3f365bbca69120c /test/integration/routing/principal_memberships_test.rb | |
parent | d72e1f95ba4f5c354fbb701808c20c99266077fd (diff) | |
download | redmine-ecda1c7a4f30354db74e73eade71550074f67356.tar.gz redmine-ecda1c7a4f30354db74e73eade71550074f67356.zip |
Use should_route in routing tests.
git-svn-id: http://svn.redmine.org/redmine/trunk@13608 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration/routing/principal_memberships_test.rb')
-rw-r--r-- | test/integration/routing/principal_memberships_test.rb | 50 |
1 files changed, 9 insertions, 41 deletions
diff --git a/test/integration/routing/principal_memberships_test.rb b/test/integration/routing/principal_memberships_test.rb index 4aeed1331..2cb3407e9 100644 --- a/test/integration/routing/principal_memberships_test.rb +++ b/test/integration/routing/principal_memberships_test.rb @@ -17,50 +17,18 @@ require File.expand_path('../../../test_helper', __FILE__) -class RoutingPrincipalMembershipsTest < ActionDispatch::IntegrationTest +class RoutingPrincipalMembershipsTest < Redmine::RoutingTest def test_user_memberships - assert_routing( - { :method => 'get', :path => "/users/123/memberships/new" }, - { :controller => 'principal_memberships', :action => 'new', - :user_id => '123' } - ) - assert_routing( - { :method => 'post', :path => "/users/123/memberships" }, - { :controller => 'principal_memberships', :action => 'create', - :user_id => '123' } - ) - assert_routing( - { :method => 'put', :path => "/users/123/memberships/55" }, - { :controller => 'principal_memberships', :action => 'update', - :user_id => '123', :id => '55' } - ) - assert_routing( - { :method => 'delete', :path => "/users/123/memberships/55" }, - { :controller => 'principal_memberships', :action => 'destroy', - :user_id => '123', :id => '55' } - ) + should_route 'GET /users/123/memberships/new' => 'principal_memberships#new', :user_id => '123' + should_route 'POST /users/123/memberships' => 'principal_memberships#create', :user_id => '123' + should_route 'PUT /users/123/memberships/55' => 'principal_memberships#update', :user_id => '123', :id => '55' + should_route 'DELETE /users/123/memberships/55' => 'principal_memberships#destroy', :user_id => '123', :id => '55' end def test_group_memberships - assert_routing( - { :method => 'get', :path => "/groups/123/memberships/new" }, - { :controller => 'principal_memberships', :action => 'new', - :group_id => '123' } - ) - assert_routing( - { :method => 'post', :path => "/groups/123/memberships" }, - { :controller => 'principal_memberships', :action => 'create', - :group_id => '123' } - ) - assert_routing( - { :method => 'put', :path => "/groups/123/memberships/55" }, - { :controller => 'principal_memberships', :action => 'update', - :group_id => '123', :id => '55' } - ) - assert_routing( - { :method => 'delete', :path => "/groups/123/memberships/55" }, - { :controller => 'principal_memberships', :action => 'destroy', - :group_id => '123', :id => '55' } - ) + should_route 'GET /groups/123/memberships/new' => 'principal_memberships#new', :group_id => '123' + should_route 'POST /groups/123/memberships' => 'principal_memberships#create', :group_id => '123' + should_route 'PUT /groups/123/memberships/55' => 'principal_memberships#update', :group_id => '123', :id => '55' + should_route 'DELETE /groups/123/memberships/55' => 'principal_memberships#destroy', :group_id => '123', :id => '55' end end |