diff options
author | José Valim <jose.valim@gmail.com> | 2012-01-15 08:04:09 -0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-01-15 08:04:09 -0800 |
commit | 42159354b4ee6145fe3fa9e169af48380c6134e0 (patch) | |
tree | 761c98c7a807d12d2c3ff6be90709ed7d00c16f6 /railties/test | |
parent | dee595ce04b65d27294912faff146ed402ded6d1 (diff) | |
parent | 666f9316ebaa13d594c6b66e095096c52d82e3f1 (diff) | |
download | rails-42159354b4ee6145fe3fa9e169af48380c6134e0.tar.gz rails-42159354b4ee6145fe3fa9e169af48380c6134e0.tar.bz2 rails-42159354b4ee6145fe3fa9e169af48380c6134e0.zip |
Merge pull request #4474 from guilleiguaran/fix-route-inspector-3-2-stable
Don't hardcode assets route skipped in route inspector (3-2-stable)
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 |