diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2019-03-27 16:31:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-27 16:31:16 -0400 |
commit | 93dbbe3a81bee6da2f1e88ca6971299b462cad93 (patch) | |
tree | f2e207eac70d70ee375fc69db7c7b03fd133a729 /actionpack/test | |
parent | 3a0929901ffa852bab9644c662b811d42780c3a1 (diff) | |
parent | 25f2e0c39da2b9c61db75df2d767ee9c10d583b8 (diff) | |
download | rails-93dbbe3a81bee6da2f1e88ca6971299b462cad93.tar.gz rails-93dbbe3a81bee6da2f1e88ca6971299b462cad93.tar.bz2 rails-93dbbe3a81bee6da2f1e88ca6971299b462cad93.zip |
Merge pull request #35236 from renuo/fix-30467
Prohibit sneaky custom params from being drawn (Fix #30467)
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index 897d17885e..7b763ec2bd 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -3338,6 +3338,16 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest assert_equal "0c0c0b68-d24b-11e1-a861-001ff3fffe6f", @request.params[:download] end + def test_colon_containing_custom_param + ex = assert_raises(ArgumentError) { + draw do + resources :profiles, param: "username/:is_admin" + end + } + + assert_match(/:param option can't contain colon/, ex.message) + end + def test_action_from_path_is_not_frozen draw do get "search" => "search" |