test: route: simplify account tests

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8365 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-12-25 12:35:22 +00:00
parent b01c02c5b8
commit 3ae98e0b8d
1 changed files with 18 additions and 24 deletions

View File

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