From 4d84922840deb89754f5b5fb61ebea0aeadc52df Mon Sep 17 00:00:00 2001 From: Melanie Gilman Date: Mon, 24 Nov 2014 10:06:16 -0500 Subject: Deprecate string options in URL helpers Fixes https://github.com/rails/rails/issues/16958 [Byron Bischoff & Melanie Gilman] --- actionpack/test/dispatch/routing/route_set_test.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'actionpack/test/dispatch/routing/route_set_test.rb') diff --git a/actionpack/test/dispatch/routing/route_set_test.rb b/actionpack/test/dispatch/routing/route_set_test.rb index a7acc0de41..5a39119446 100644 --- a/actionpack/test/dispatch/routing/route_set_test.rb +++ b/actionpack/test/dispatch/routing/route_set_test.rb @@ -160,6 +160,26 @@ module ActionDispatch assert_equal '/foo/1/bar/2', url_helpers.foo_bar_path(2, foo_id: 1) end + test "stringified controller and action keys are properly symbolized" do + draw do + root 'foo#bar' + end + + assert_deprecated do + assert_equal '/', url_helpers.root_path('controller' => 'foo', 'action' => 'bar') + end + end + + test "mix of string and symbol keys are properly symbolized" do + draw do + root 'foo#bar' + end + + assert_deprecated do + assert_equal '/', url_helpers.root_path('controller' => 'foo', :action => 'bar') + end + end + private def draw(&block) @set.draw(&block) -- cgit v1.2.3