diff options
author | Chris Arcand <chris@chrisarcand.com> | 2016-07-21 15:59:05 -0500 |
---|---|---|
committer | Chris Arcand <chris@chrisarcand.com> | 2016-07-21 15:59:05 -0500 |
commit | 31fbbb7faccba25b2e3b5e10b8fca1468579d629 (patch) | |
tree | e04f75d020badc4ba2e210b1b54ef580b8af12a0 /actionpack/test/dispatch | |
parent | f88495d519f9bdacd542d61b4e8117eb4f79c173 (diff) | |
download | rails-31fbbb7faccba25b2e3b5e10b8fca1468579d629.tar.gz rails-31fbbb7faccba25b2e3b5e10b8fca1468579d629.tar.bz2 rails-31fbbb7faccba25b2e3b5e10b8fca1468579d629.zip |
Fix 'defaults' option for root route
The merging of the 'defaults' option was moved up the stack in e852daa
This allows us to see where these options originate from the standard
HttpHelpers (get, post, patch, put, delete)
Unfortunately this move didn't incorporate the 'root' method, which has
always allowed the same 'defaults' option before.
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index 5298e63fef..2fe40de583 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -1759,6 +1759,24 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest assert_equal 1, @request.params[:page] end + def test_keyed_default_string_params_with_root + draw do + root :to => 'pages#show', :defaults => { :id => 'home' } + end + + get '/' + assert_equal 'home', @request.params[:id] + end + + def test_default_string_params_with_root + draw do + root :to => 'pages#show', :id => 'home' + end + + get '/' + assert_equal 'home', @request.params[:id] + end + def test_resource_constraints draw do resources :products, :constraints => { :id => /\d{4}/ } do |