]> source.dussan.org Git - redmine.git/commitdiff
test: route: simplify account tests
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sun, 25 Dec 2011 12:35:22 +0000 (12:35 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sun, 25 Dec 2011 12:35:22 +0000 (12:35 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8365 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/integration/routing/account_test.rb

index f524099f09e14e43e23e8cd898647487464b8ac8..c9b9cd60de27af1ab4dfedf9e5a44b020af721fa 100644 (file)
@@ -19,34 +19,28 @@ require File.expand_path('../../../test_helper', __FILE__)
 
 class RoutingAccountTest < ActionController::IntegrationTest
   def test_account
-    assert_routing(
-        { :method => 'get', :path => "/login" },
-        { :controller => 'account', :action => 'login' }
-      )
-    assert_routing(
-        { :method => 'post', :path => "/login" },
-        { :controller => 'account', :action => 'login' }
-      )
+    ["get", "post"].each do |method|
+      assert_routing(
+          { :method => method, :path => "/login" },
+          { :controller => 'account', :action => 'login' }
+        )
+    end
     assert_routing(
         { :method => 'get', :path => "/logout" },
         { :controller => 'account', :action => 'logout' }
       )
-    assert_routing(
-        { :method => 'get', :path => "/account/register" },
-        { :controller => 'account', :action => 'register' }
-      )
-    assert_routing(
-        { :method => 'post', :path => "/account/register" },
-        { :controller => 'account', :action => 'register' }
-      )
-    assert_routing(
-        { :method => 'get', :path => "/account/lost_password" },
-        { :controller => 'account', :action => 'lost_password' }
-      )
-    assert_routing(
-        { :method => 'post', :path => "/account/lost_password" },
-        { :controller => 'account', :action => 'lost_password' }
-      )
+    ["get", "post"].each do |method|
+      assert_routing(
+          { :method => method, :path => "/account/register" },
+          { :controller => 'account', :action => 'register' }
+        )
+    end
+    ["get", "post"].each do |method|
+      assert_routing(
+          { :method => method, :path => "/account/lost_password" },
+          { :controller => 'account', :action => 'lost_password' }
+        )
+    end
     assert_routing(
         { :method => 'get', :path => "/account/activate" },
         { :controller => 'account', :action => 'activate' }