aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application
diff options
context:
space:
mode:
authorNicholas Firth-McCoy <nicholas@2suggestions.com.au>2016-06-18 18:46:44 +1000
committerNicholas Firth-McCoy <nicholas@2suggestions.com.au>2016-06-20 21:49:12 +1000
commit9d513e0a19f2b9333cd752b2747db4f350fcddc4 (patch)
tree551ad637aa116ba0944cf0d436f3981d7aa574f1 /railties/test/application
parent0c998a14c45430afe85188f8ad13a696b077ffd9 (diff)
downloadrails-9d513e0a19f2b9333cd752b2747db4f350fcddc4.tar.gz
rails-9d513e0a19f2b9333cd752b2747db4f350fcddc4.tar.bz2
rails-9d513e0a19f2b9333cd752b2747db4f350fcddc4.zip
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.
Diffstat (limited to 'railties/test/application')
-rw-r--r--railties/test/application/routing_test.rb19
1 files changed, 19 insertions, 0 deletions
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")