@@ -361,8 +361,8 @@ def test_global
361361 draw do
362362 controller ( :global ) do
363363 get 'global/hide_notice'
364- get 'global/export' , :to => :export , :as => :export_request
365- get '/export/:id/:file' , :to => :export , :as => :export_download , :constraints => { :file => /.*/ }
364+ get 'global/export' , :action => :export , :as => :export_request
365+ get '/export/:id/:file' , :action => :export , :as => :export_download , :constraints => { :file => /.*/ }
366366 get 'global/:action'
367367 end
368368 end
@@ -730,8 +730,8 @@ def test_replies
730730 draw do
731731 resources :replies do
732732 member do
733- put :answer , :to => :mark_as_answer
734- delete :answer , :to => :unmark_as_answer
733+ put :answer , :action => :mark_as_answer
734+ delete :answer , :action => :unmark_as_answer
735735 end
736736 end
737737 end
@@ -1188,7 +1188,7 @@ def test_articles_with_id
11881188 controller :articles do
11891189 scope '/articles' , :as => 'article' do
11901190 scope :path => '/:title' , :title => /[a-z]+/ , :as => :with_title do
1191- get '/:id' , :to => :with_id , :as => ""
1191+ get '/:id' , :action => :with_id , :as => ""
11921192 end
11931193 end
11941194 end
@@ -1435,7 +1435,7 @@ def test_dynamically_generated_helpers_on_collection_do_not_clobber_resources_ur
14351435 def test_scoped_controller_with_namespace_and_action
14361436 draw do
14371437 namespace :account do
1438- get ':action/callback' , :action => /twitter|github/ , :to => "callbacks" , :as => :callback
1438+ get ':action/callback' , :action => /twitter|github/ , :controller => "callbacks" , :as => :callback
14391439 end
14401440 end
14411441
@@ -1492,7 +1492,7 @@ def test_redirect_with_port
14921492 def test_normalize_namespaced_matches
14931493 draw do
14941494 namespace :account do
1495- get 'description' , :to => :description , :as => "description"
1495+ get 'description' , :action => :description , :as => "description"
14961496 end
14971497 end
14981498
@@ -2154,7 +2154,7 @@ def test_custom_resource_routes_are_scoped
21542154 end
21552155 resources :invoices do
21562156 get "outstanding" => "invoices#outstanding" , :on => :collection
2157- get "overdue" , :to => :overdue , :on => :collection
2157+ get "overdue" , :action => :overdue , :on => :collection
21582158 get "print" => "invoices#print" , :as => :print , :on => :member
21592159 post "preview" => "invoices#preview" , :as => :preview , :on => :new
21602160 end
@@ -2996,7 +2996,9 @@ def test_controller_name_with_leading_slash_raise_error
29962996 end
29972997
29982998 assert_raise ( ArgumentError ) do
2999- draw { controller ( "/feeds" ) { get '/feeds/:service' , :to => :show } }
2999+ assert_deprecated do
3000+ draw { controller ( "/feeds" ) { get '/feeds/:service' , :to => :show } }
3001+ end
30003002 end
30013003
30023004 assert_raise ( ArgumentError ) do
@@ -3284,20 +3286,24 @@ def test_mix_string_to_action
32843286 end
32853287
32863288 def test_mix_symbol_to_controller_action
3287- draw do
3288- get '/projects' , controller : 'project_files' ,
3289- action : 'index' ,
3290- to : :show
3289+ assert_deprecated do
3290+ draw do
3291+ get '/projects' , controller : 'project_files' ,
3292+ action : 'index' ,
3293+ to : :show
3294+ end
32913295 end
32923296 get '/projects'
32933297 assert_equal 'project_files#show' , @response . body
32943298 end
32953299
3296- def test_mix_string_to_controller_action
3297- draw do
3298- get '/projects' , controller : 'project_files' ,
3299- action : 'index' ,
3300- to : 'show'
3300+ def test_mix_string_to_controller_action_no_hash
3301+ assert_deprecated do
3302+ draw do
3303+ get '/projects' , controller : 'project_files' ,
3304+ action : 'index' ,
3305+ to : 'show'
3306+ end
33013307 end
33023308 get '/projects'
33033309 assert_equal 'show#index' , @response . body
@@ -3567,16 +3573,18 @@ def draw(&block)
35673573 def test_missing_controller
35683574 ex = assert_raises ( ArgumentError ) {
35693575 draw do
3570- get '/foo/bar' , :to => :index
3576+ get '/foo/bar' , :action => :index
35713577 end
35723578 }
35733579 assert_match ( /Missing :controller/ , ex . message )
35743580 end
35753581
35763582 def test_missing_action
35773583 ex = assert_raises ( ArgumentError ) {
3578- draw do
3579- get '/foo/bar' , :to => 'foo'
3584+ assert_deprecated do
3585+ draw do
3586+ get '/foo/bar' , :to => 'foo'
3587+ end
35803588 end
35813589 }
35823590 assert_match ( /Missing :action/ , ex . message )
@@ -4083,7 +4091,7 @@ def show
40834091 set . draw do
40844092 get "/bar/:id" , :to => redirect ( "/foo/show/%{id}" )
40854093 get "/foo/show(/:id)" , :to => "test_invalid_urls/foo#show"
4086- get "/foo(/:action(/:id))" , :to => "test_invalid_urls/foo"
4094+ get "/foo(/:action(/:id))" , :controller => "test_invalid_urls/foo"
40874095 get "/:controller(/:action(/:id))"
40884096 end
40894097
0 commit comments