aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/routing_test.rb
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2013-01-21 17:05:49 +0000
committerAndrew White <andyw@pixeltrix.co.uk>2013-01-21 17:14:10 +0000
commitc4106d0c08954b0761726e0015ec601b7bc7ea4b (patch)
tree97d44edf9f4c9a6351eb6933d78dc1c0cf981c41 /actionpack/test/dispatch/routing_test.rb
parent4e327225947b933d5434509e02e98226c581adc1 (diff)
downloadrails-c4106d0c08954b0761726e0015ec601b7bc7ea4b.tar.gz
rails-c4106d0c08954b0761726e0015ec601b7bc7ea4b.tar.bz2
rails-c4106d0c08954b0761726e0015ec601b7bc7ea4b.zip
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
Diffstat (limited to 'actionpack/test/dispatch/routing_test.rb')
-rw-r--r--actionpack/test/dispatch/routing_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb
index da7474e73c..9f31ce8127 100644
--- a/actionpack/test/dispatch/routing_test.rb
+++ b/actionpack/test/dispatch/routing_test.rb
@@ -2678,6 +2678,15 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
assert_equal '0c0c0b68-d24b-11e1-a861-001ff3fffe6f', @request.params[:download]
end
+ def test_action_from_path_is_not_frozen
+ draw do
+ get 'search' => 'search'
+ end
+
+ get '/search'
+ assert !@request.params[:action].frozen?
+ end
+
private
def draw(&block)