diff options
Diffstat (limited to 'actionpack/test/dispatch/routing_test.rb')
-rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index e61b4e2d8f..6ecf011694 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -515,6 +515,8 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest match '/sculptors', :to => 'italians#sculptors' match '/painters/:painter', :to => 'italians#painters', :constraints => {:painter => /michelangelo/} end + + get 'search' => 'search' end end @@ -887,6 +889,15 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest assert_equal original_options, options end + def test_url_for_does_not_modify_controller + controller = '/projects' + options = {:controller => controller, :action => 'status', :only_path => true} + url = url_for(options) + + assert_equal '/projects/status', url + assert_equal '/projects', controller + end + # tests the arguments modification free version of define_hash_access def test_named_route_with_no_side_effects original_options = { :host => 'test.host' } @@ -2468,6 +2479,11 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest assert_equal "/posts/1/admin", post_admin_root_path(:post_id => '1') end + def test_action_from_path_is_not_frozen + get '/search' + assert !@request.params[:action].frozen? + end + private def with_test_routes yield |