diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2016-06-07 20:59:26 -0400 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2016-06-07 20:59:26 -0400 |
commit | c32e36d05c04b87d2f1bfbe313360e5664d82fe5 (patch) | |
tree | 3e9e5decc3b48422cbe1ea534625236be79817e1 /actionpack/test | |
parent | 5eea500ecf5858048ec69dbecb70d3f90f2a1024 (diff) | |
parent | 20ab1bf4f707096ff0bd765e7248f9c3a6b2c520 (diff) | |
download | rails-c32e36d05c04b87d2f1bfbe313360e5664d82fe5.tar.gz rails-c32e36d05c04b87d2f1bfbe313360e5664d82fe5.tar.bz2 rails-c32e36d05c04b87d2f1bfbe313360e5664d82fe5.zip |
Merge pull request #25281 from maclover7/jm-add-internal
`{ internal: true }` from being stored in the router
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index ade4b0c381..75fdc9469f 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -4795,3 +4795,33 @@ class TestPathParameters < ActionDispatch::IntegrationTest assert_equal "/ar | /ar/about", @response.body end end + +class TestInternalRoutingParams < ActionDispatch::IntegrationTest + Routes = ActionDispatch::Routing::RouteSet.new.tap do |app| + app.draw do + get '/test_internal/:internal' => 'internal#internal' + end + end + + class ::InternalController < ActionController::Base + def internal + head :ok + end + end + + APP = build_app Routes + + def app + APP + end + + def test_paths_with_partial_dynamic_segments_are_recognised + get '/test_internal/123' + assert_equal 200, response.status + + assert_equal( + { controller: 'internal', action: 'internal', internal: '123' }, + request.path_parameters + ) + end +end |