diff options
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/route_inspect_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/railties/test/application/route_inspect_test.rb b/railties/test/application/route_inspect_test.rb index 6503251b9f..b897cf15b8 100644 --- a/railties/test/application/route_inspect_test.rb +++ b/railties/test/application/route_inspect_test.rb @@ -1,4 +1,5 @@ require 'test/unit' +require 'mocha' require 'rails/application/route_inspector' require 'action_controller' require 'rails/engine' @@ -8,6 +9,11 @@ module ApplicationTests def setup @set = ActionDispatch::Routing::RouteSet.new @inspector = Rails::Application::RouteInspector.new + app = ActiveSupport::OrderedOptions.new + app.config = ActiveSupport::OrderedOptions.new + app.config.assets = ActiveSupport::OrderedOptions.new + app.config.assets.prefix = '/sprockets' + Rails.stubs(:application).returns(app) end def test_displaying_routes_for_engines @@ -144,5 +150,14 @@ module ApplicationTests output = @inspector.format @set.routes assert_equal [" /foo #{RackApp.name} {:constraint=>( my custom constraint )}"], output end + + def test_rake_routes_dont_show_app_mounted_in_assets_prefix + @set.draw do + match '/sprockets' => RackApp + end + output = @inspector.format @set.routes + assert_no_match(/RackApp/, output.first) + assert_no_match(/\/sprockets/, output.first) + end end end |