aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2014-01-24 04:34:22 -0800
committerYves Senn <yves.senn@gmail.com>2014-01-24 04:34:22 -0800
commit8efd5fec75b5241d2b25f547bb0d90fd01bbafbd (patch)
tree0e7d045b801c0481d28711421c23d75eff72346b /actionpack/test
parente61b841a4f5bb9d4d1cd6993ac9cebd53ca1ba32 (diff)
parentc1f8a0d61409b6c9fa16847b0ecf694cc4d4cecf (diff)
downloadrails-8efd5fec75b5241d2b25f547bb0d90fd01bbafbd.tar.gz
rails-8efd5fec75b5241d2b25f547bb0d90fd01bbafbd.tar.bz2
rails-8efd5fec75b5241d2b25f547bb0d90fd01bbafbd.zip
Merge pull request #13811 from mdesantis/issue-13810
Fixes #13810 `rake routes` error when mount `Rails::Engine` with empty routes
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'