From 019eea4a388442a004287ad2e73772f3fefc7028 Mon Sep 17 00:00:00 2001 From: Pawel Pierzchala Date: Wed, 21 Sep 2011 18:12:55 +0200 Subject: Fix named routes modifying arguments --- actionpack/test/dispatch/routing_test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index 9685b24c1c..c0b74bc9f9 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -863,6 +863,17 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest assert_equal original_options, 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' } + options = original_options.dup + + profile_customer_url("customer_model", options) + + # verify that the options passed in have not changed from the original ones + assert_equal original_options, options + end + def test_projects_status with_test_routes do assert_equal '/projects/status', url_for(:controller => 'projects', :action => 'status', :only_path => true) -- cgit v1.2.3