aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/routing_test.rb
diff options
context:
space:
mode:
authorNikita Beloglazov <nikelandjelo@gmail.com>2012-04-26 21:05:56 +0300
committerAndrew White <andyw@pixeltrix.co.uk>2012-05-09 11:53:14 +0100
commite154823935859ae918ca26a7e73477d331e4a142 (patch)
tree0e6871563132af959171d5f4df8f113b01949a48 /actionpack/test/dispatch/routing_test.rb
parentf1cc45e56a4fc6e80bb4be4434dbf49d41adfd83 (diff)
downloadrails-e154823935859ae918ca26a7e73477d331e4a142.tar.gz
rails-e154823935859ae918ca26a7e73477d331e4a142.tar.bz2
rails-e154823935859ae918ca26a7e73477d331e4a142.zip
Fix bug when url_for changes controller.
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 e5345754cd..6d0cfe9b8a 100644
--- a/actionpack/test/dispatch/routing_test.rb
+++ b/actionpack/test/dispatch/routing_test.rb
@@ -829,6 +829,15 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
assert_equal original_options, options
end
+ # checks that url_for doesn't change controller and action
+ def test_url_for_with_no_side_effects_on_strings
+ # freeze controller and action to be sure they are not changed
+ # we'll get RuntimeError if somebody tries to modify them
+ options = {:controller => '/projects'.freeze, :action => 'status'.freeze}
+
+ url_for options
+ end
+
# tests the arguments modification free version of define_hash_access
def test_named_route_with_no_side_effects
original_options = { :host => 'test.host' }