From 431759614d84395faa713ebdfa8bd1cadc97183a Mon Sep 17 00:00:00 2001 From: Andrew White Date: Mon, 21 Jan 2013 17:20:51 +0000 Subject: Duplicate possible frozen string from route Ruby 1.9 freezes Hash string keys by default so where a route is defined like this: get 'search' => 'search' then the Mapper will derive the action from the key. This blows up later when the action is added to the parameters hash and the encoding is forced. Closes #3429 --- actionpack/test/dispatch/routing_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index 46d16598f7..6ecf011694 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -515,6 +515,8 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest match '/sculptors', :to => 'italians#sculptors' match '/painters/:painter', :to => 'italians#painters', :constraints => {:painter => /michelangelo/} end + + get 'search' => 'search' end end @@ -2477,6 +2479,11 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest assert_equal "/posts/1/admin", post_admin_root_path(:post_id => '1') end + def test_action_from_path_is_not_frozen + get '/search' + assert !@request.params[:action].frozen? + end + private def with_test_routes yield -- cgit v1.2.3