From e154823935859ae918ca26a7e73477d331e4a142 Mon Sep 17 00:00:00 2001 From: Nikita Beloglazov Date: Thu, 26 Apr 2012 21:05:56 +0300 Subject: Fix bug when url_for changes controller. --- actionpack/test/dispatch/routing_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'actionpack/test/dispatch/routing_test.rb') 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' } -- cgit v1.2.3