From 9d513e0a19f2b9333cd752b2747db4f350fcddc4 Mon Sep 17 00:00:00 2001 From: Nicholas Firth-McCoy Date: Sat, 18 Jun 2016 18:46:44 +1000 Subject: Fix rails/info routes for apps with globbing route The /rails/info routes were inaccessible in apps with a catch-all globbing route, as they were being appended after the globbing route and would never be matched. See also ccc3ddb7762bae0df7e2f8d643b19b6a4769d5be. --- railties/test/application/routing_test.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'railties/test') diff --git a/railties/test/application/routing_test.rb b/railties/test/application/routing_test.rb index e51f32aaed..93847c7aa9 100644 --- a/railties/test/application/routing_test.rb +++ b/railties/test/application/routing_test.rb @@ -39,6 +39,25 @@ module ApplicationTests assert_equal 200, last_response.status end + test "/rails/info routes are accessible with globbing route present" do + app("development") + + app_file "config/routes.rb", <<-RUBY + Rails.application.routes.draw do + get '*foo', to: 'foo#index' + end + RUBY + + get "/rails/info" + assert_equal 302, last_response.status + + get "rails/info/routes" + assert_equal 200, last_response.status + + get "rails/info/properties" + assert_equal 200, last_response.status + end + test "root takes precedence over internal welcome controller" do app("development") -- cgit v1.2.3