diff options
author | Nikita Beloglazov <nikelandjelo@gmail.com> | 2012-04-26 21:05:56 +0300 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-11-16 21:44:18 -0200 |
commit | 09c4dfa06bcf049ada7b127f70d3c5eb5e9cd91d (patch) | |
tree | cd75c401de5b91d51c4615a4d3da1d0d8ff316c0 /actionpack/test | |
parent | 88a296dccc401da143d90cad54b693ff06bf2b58 (diff) | |
download | rails-09c4dfa06bcf049ada7b127f70d3c5eb5e9cd91d.tar.gz rails-09c4dfa06bcf049ada7b127f70d3c5eb5e9cd91d.tar.bz2 rails-09c4dfa06bcf049ada7b127f70d3c5eb5e9cd91d.zip |
Fix bug when url_for changes controller.
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index e61b4e2d8f..91ca058a5d 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -887,6 +887,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' } |