diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2009-12-24 15:23:39 -0800 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2009-12-24 15:23:39 -0800 |
commit | 2b7256a42e63640d6e94fe80ee67093ed0f06e4c (patch) | |
tree | 81b026a86587ef4255b7c7a5b9e03ebc8aa79d52 /actionpack/test | |
parent | 74b2e00ce848fac41409eedced1cd671f473b5ce (diff) | |
download | rails-2b7256a42e63640d6e94fe80ee67093ed0f06e4c.tar.gz rails-2b7256a42e63640d6e94fe80ee67093ed0f06e4c.tar.bz2 rails-2b7256a42e63640d6e94fe80ee67093ed0f06e4c.zip |
Extract Mapping class from monster match method
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index 1c7822358d..f7f93290df 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -22,7 +22,7 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest delete 'logout', :to => :destroy, :as => :logout end - match 'account/logout' => redirect("/logout") + match 'account/logout' => redirect("/logout"), :as => :logout_redirect match 'account/login', :to => redirect("/login") match 'account/modulo/:name', :to => redirect("/%{name}s") @@ -110,6 +110,7 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest resources :rooms end + match '/info' => 'projects#info', :as => 'info' root :to => 'projects#index' end end @@ -153,6 +154,7 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest def test_logout_redirect_without_to with_test_routes do + assert_equal '/account/logout', logout_redirect_path get '/account/logout' assert_equal 301, @response.status assert_equal 'http://www.example.com/logout', @response.headers['Location'] @@ -462,10 +464,19 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest def test_root with_test_routes do + assert_equal '/', root_path get '/' assert_equal 'projects#index', @response.body end end + + def test_index + with_test_routes do + assert_equal '/info', info_path + get '/info' + assert_equal 'projects#info', @response.body + end + end private def with_test_routes |