aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorMaurizio De Santis <m.desantis@morganspa.com>2014-01-23 14:50:29 +0100
committerMaurizio De Santis <desantis.maurizio@gmail.com>2014-01-24 12:41:48 +0100
commitc1f8a0d61409b6c9fa16847b0ecf694cc4d4cecf (patch)
tree5f59ae676ee1124cacec3f1ffb7308f4c3fbefe4 /actionpack/test
parent6ef0569b0bf6e13d63f6c51790745b2007b92973 (diff)
downloadrails-c1f8a0d61409b6c9fa16847b0ecf694cc4d4cecf.tar.gz
rails-c1f8a0d61409b6c9fa16847b0ecf694cc4d4cecf.tar.bz2
rails-c1f8a0d61409b6c9fa16847b0ecf694cc4d4cecf.zip
Fix `rake routes` error when `Rails::Engine` with empty routes is mounted; fixes rails/rails#13810
Squash
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/dispatch/routing/inspector_test.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing/inspector_test.rb b/actionpack/test/dispatch/routing/inspector_test.rb
index 8045464284..74515e3f57 100644
--- a/actionpack/test/dispatch/routing/inspector_test.rb
+++ b/actionpack/test/dispatch/routing/inspector_test.rb
@@ -54,6 +54,27 @@ module ActionDispatch
], output
end
+ def test_displaying_routes_for_engines_without_routes
+ engine = Class.new(Rails::Engine) do
+ def self.inspect
+ "Blog::Engine"
+ end
+ end
+ engine.routes.draw do
+ end
+
+ output = draw do
+ mount engine => "/blog", as: "blog"
+ end
+
+ assert_equal [
+ "Prefix Verb URI Pattern Controller#Action",
+ " blog /blog Blog::Engine",
+ "",
+ "Routes for Blog::Engine:"
+ ], output
+ end
+
def test_cart_inspect
output = draw do
get '/cart', :to => 'cart#show'