From 0c7a236f30c12c981cf376d08ac01e423308533d Mon Sep 17 00:00:00 2001 From: Andrew White Date: Wed, 9 May 2012 11:48:33 +0100 Subject: Refactor Generator class to not rely on in-place editing the controller --- actionpack/test/dispatch/routing_test.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (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 91ca058a5d..46d16598f7 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -887,13 +887,13 @@ 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} + def test_url_for_does_not_modify_controller + controller = '/projects' + options = {:controller => controller, :action => 'status', :only_path => true} + url = url_for(options) - url_for options + assert_equal '/projects/status', url + assert_equal '/projects', controller end # tests the arguments modification free version of define_hash_access -- cgit v1.2.3