aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/journey/router_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/journey/router_test.rb')
-rw-r--r--actionpack/test/journey/router_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/journey/router_test.rb b/actionpack/test/journey/router_test.rb
index 802fb93c69..c4bffa2f15 100644
--- a/actionpack/test/journey/router_test.rb
+++ b/actionpack/test/journey/router_test.rb
@@ -219,6 +219,13 @@ module ActionDispatch
assert_equal 404, resp.first
end
+ def test_invalid_url_path
+ routes = Class.new { include ActionDispatch::Routing::Redirection }.new
+ route = routes.redirect("/foo/bar/%{id}")
+ resp = route.serve(rails_env({ 'REQUEST_METHOD' => 'GET', 'PATH_INFO' => '/foo/(function(){})' }))
+ assert_equal 400, resp.first
+ end
+
def test_clear_trailing_slash_from_script_name_on_root_unanchored_routes
route_set = Routing::RouteSet.new
mapper = Routing::Mapper.new route_set