From 3ae98e0b8d7db0bee562192dccd884f218087f0d 2011-12-25 12:35:22 From: Toshi MARUYAMA Date: 2011-12-25 12:35:22 Subject: [PATCH] test: route: simplify account tests git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8365 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/test/integration/routing/account_test.rb b/test/integration/routing/account_test.rb index f524099..c9b9cd6 100644 --- a/test/integration/routing/account_test.rb +++ b/test/integration/routing/account_test.rb @@ -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' }