aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2016-07-27 20:27:17 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2016-07-27 20:28:54 -0300
commitc1dc565f1e5da3d9a680cc25ae3a06c739d4d149 (patch)
treedd7535884fd6aaf5732b1bc1be1358c0f5f0fdbc /actionpack/test
parent4f8a594f18004476c7851d8a59dae92fe001266e (diff)
parent2a946da9bbccfbd1e52b1164f4f4a77d5dbe3c10 (diff)
downloadrails-c1dc565f1e5da3d9a680cc25ae3a06c739d4d149.tar.gz
rails-c1dc565f1e5da3d9a680cc25ae3a06c739d4d149.tar.bz2
rails-c1dc565f1e5da3d9a680cc25ae3a06c739d4d149.zip
Merge pull request #25913 from chrisarcand/fix-keyed-defaults-with-root
Fix keyed defaults with root
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/dispatch/routing_test.rb18
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..cac89417a5 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