]> source.dussan.org Git - redmine.git/commitdiff
test: replace "should_route" of "users" to "assert_routing" at integration/routing_te...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 17 Dec 2011 09:56:00 +0000 (09:56 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 17 Dec 2011 09:56:00 +0000 (09:56 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8252 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/integration/routing_test.rb

index 8f46bb811df1d62661c5c35afa14a9fe2665d509..bc6861f39ee920107834381f76df453c000c095e 100644 (file)
@@ -838,28 +838,82 @@ class RoutingTest < ActionController::IntegrationTest
     should_route :get, "/projects/567/time_entries/report.csv", :controller => 'timelog', :action => 'report', :project_id => '567', :format => 'csv'
   end
 
-  context "users" do
-    should_route :get, "/users", :controller => 'users', :action => 'index'
-    should_route :get, "/users.xml", :controller => 'users', :action => 'index', :format => 'xml'
-    should_route :get, "/users/44", :controller => 'users', :action => 'show', :id => '44'
-    should_route :get, "/users/44.xml", :controller => 'users', :action => 'show', :id => '44', :format => 'xml'
-    should_route :get, "/users/current", :controller => 'users', :action => 'show', :id => 'current'
-    should_route :get, "/users/current.xml", :controller => 'users', :action => 'show', :id => 'current', :format => 'xml'
-    should_route :get, "/users/new", :controller => 'users', :action => 'new'
-    should_route :get, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444'
-
-    should_route :post, "/users", :controller => 'users', :action => 'create'
-    should_route :post, "/users.xml", :controller => 'users', :action => 'create', :format => 'xml'
-
-    should_route :put, "/users/444", :controller => 'users', :action => 'update', :id => '444'
-    should_route :put, "/users/444.xml", :controller => 'users', :action => 'update', :id => '444', :format => 'xml'
-
-    should_route :delete, "/users/44", :controller => 'users', :action => 'destroy', :id => '44'
-    should_route :delete, "/users/44.xml", :controller => 'users', :action => 'destroy', :id => '44', :format => 'xml'
-
-    should_route :post, "/users/123/memberships", :controller => 'users', :action => 'edit_membership', :id => '123'
-    should_route :put, "/users/123/memberships/55", :controller => 'users', :action => 'edit_membership', :id => '123', :membership_id => '55'
-    should_route :delete, "/users/123/memberships/55", :controller => 'users', :action => 'destroy_membership', :id => '123', :membership_id => '55'
+  def test_users
+    assert_routing(
+        { :method => 'get', :path => "/users" },
+        { :controller => 'users', :action => 'index' }
+      )
+    assert_routing(
+        { :method => 'get', :path => "/users.xml" },
+        { :controller => 'users', :action => 'index', :format => 'xml' }
+      )
+    assert_routing(
+        { :method => 'get', :path => "/users/44" },
+        { :controller => 'users', :action => 'show', :id => '44' }
+      )
+    assert_routing(
+        { :method => 'get', :path => "/users/44.xml" },
+        { :controller => 'users', :action => 'show', :id => '44',
+          :format => 'xml' }
+      )
+    assert_routing(
+        { :method => 'get', :path => "/users/current" },
+        { :controller => 'users', :action => 'show', :id => 'current' }
+      )
+    assert_routing(
+        { :method => 'get', :path => "/users/current.xml" },
+        { :controller => 'users', :action => 'show', :id => 'current',
+          :format => 'xml' }
+      )
+    assert_routing(
+        { :method => 'get', :path => "/users/new" },
+        { :controller => 'users', :action => 'new' }
+      )
+    assert_routing(
+        { :method => 'get', :path => "/users/444/edit" },
+        { :controller => 'users', :action => 'edit', :id => '444' }
+      )
+    assert_routing(
+        { :method => 'post', :path => "/users" },
+        { :controller => 'users', :action => 'create' }
+      )
+    assert_routing(
+        { :method => 'post', :path => "/users.xml" },
+        { :controller => 'users', :action => 'create', :format => 'xml' }
+      )
+    assert_routing(
+        { :method => 'put', :path => "/users/444" },
+        { :controller => 'users', :action => 'update', :id => '444' }
+      )
+    assert_routing(
+        { :method => 'put', :path => "/users/444.xml" },
+        { :controller => 'users', :action => 'update', :id => '444',
+          :format => 'xml' }
+      )
+    assert_routing(
+        { :method => 'delete', :path => "/users/44" },
+        { :controller => 'users', :action => 'destroy', :id => '44' }
+      )
+    assert_routing(
+        { :method => 'delete', :path => "/users/44.xml" },
+        { :controller => 'users', :action => 'destroy', :id => '44',
+          :format => 'xml' }
+      )
+    assert_routing(
+        { :method => 'post', :path => "/users/123/memberships" },
+        { :controller => 'users', :action => 'edit_membership',
+          :id => '123' }
+      )
+    assert_routing(
+        { :method => 'put', :path => "/users/123/memberships/55" },
+        { :controller => 'users', :action => 'edit_membership',
+          :id => '123', :membership_id => '55' }
+      )
+    assert_routing(
+        { :method => 'delete', :path => "/users/123/memberships/55" },
+        { :controller => 'users', :action => 'destroy_membership',
+          :id => '123', :membership_id => '55' }
+      )
   end
 
   context "versions" do