diff options
author | José Valim <jose.valim@gmail.com> | 2010-09-05 15:45:06 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-09-05 15:45:12 +0200 |
commit | 9757bfff9b7fff21697228dd0920d8ea93fae969 (patch) | |
tree | 2bc0c9acc5f17cb03b111d9448c2e100979bd0e2 /actionpack/test/controller/test_test.rb | |
parent | e20012b64b2063b75cbf1acc57195f0c410987de (diff) | |
parent | e909afccc996293ec6b7ba2d1c6c078fe807956b (diff) | |
download | rails-9757bfff9b7fff21697228dd0920d8ea93fae969.tar.gz rails-9757bfff9b7fff21697228dd0920d8ea93fae969.tar.bz2 rails-9757bfff9b7fff21697228dd0920d8ea93fae969.zip |
Merge remote branch 'drogus/remove_deprecated_routes'
This merge removes the deprecated routes mapper from Rails and update its tests.
Diffstat (limited to 'actionpack/test/controller/test_test.rb')
-rw-r--r-- | actionpack/test/controller/test_test.rb | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/actionpack/test/controller/test_test.rb b/actionpack/test/controller/test_test.rb index e959b41219..fc7d314e04 100644 --- a/actionpack/test/controller/test_test.rb +++ b/actionpack/test/controller/test_test.rb @@ -135,6 +135,11 @@ XML @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new @request.env['PATH_INFO'] = nil + @routes = ActionDispatch::Routing::RouteSet.new.tap do |r| + r.draw do + match ':controller(/:action(/:id))' + end + end end def test_raw_post_handling @@ -454,18 +459,26 @@ XML def test_assert_routing_with_method with_routing do |set| - set.draw { |map| map.resources(:content) } + set.draw { resources(:content) } assert_routing({ :method => 'post', :path => 'content' }, { :controller => 'content', :action => 'create' }) end end def test_assert_routing_in_module - assert_routing 'admin/user', :controller => 'admin/user', :action => 'index' + with_routing do |set| + set.draw do + namespace :admin do + match 'user' => 'user#index' + end + end + + assert_routing 'admin/user', :controller => 'admin/user', :action => 'index' + end end def test_assert_routing_with_glob with_routing do |set| - set.draw { |map| match('*path' => "pages#show") } + set.draw { match('*path' => "pages#show") } assert_routing('/company/about', { :controller => 'pages', :action => 'show', :path => 'company/about' }) end end @@ -487,7 +500,7 @@ XML def test_array_path_parameter_handled_properly with_routing do |set| - set.draw do |map| + set.draw do match 'file/*path', :to => 'test_test/test#test_params' match ':controller/:action' end @@ -702,7 +715,7 @@ class NamedRoutesControllerTest < ActionController::TestCase def test_should_be_able_to_use_named_routes_before_a_request_is_done with_routing do |set| - set.draw { |map| resources :contents } + set.draw { resources :contents } assert_equal 'http://test.host/contents/new', new_content_url assert_equal 'http://test.host/contents/1', content_url(:id => 1) end |