diff options
author | José Valim <jose.valim@gmail.com> | 2012-01-15 01:30:17 -0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-01-15 01:30:17 -0800 |
commit | ff722f9b5ba79a132cc66e0af3b167305f84a179 (patch) | |
tree | f8f1229f81809062e88770b8371b226de2f28550 /railties | |
parent | cff08491a851d5aae901ab5bec17fa061c412ea6 (diff) | |
parent | 0802dc7f4f37a498c21ca0967a34304833b84381 (diff) | |
download | rails-ff722f9b5ba79a132cc66e0af3b167305f84a179.tar.gz rails-ff722f9b5ba79a132cc66e0af3b167305f84a179.tar.bz2 rails-ff722f9b5ba79a132cc66e0af3b167305f84a179.zip |
Merge pull request #4469 from guilleiguaran/fix-skipping-assets-in-route-inspector
Don't hardcode assets route skipped in route inspector
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/application/route_inspector.rb | 2 | ||||
-rw-r--r-- | railties/test/application/route_inspect_test.rb | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/railties/lib/rails/application/route_inspector.rb b/railties/lib/rails/application/route_inspector.rb index 5ca366c5f2..2ca0c68243 100644 --- a/railties/lib/rails/application/route_inspector.rb +++ b/railties/lib/rails/application/route_inspector.rb @@ -51,7 +51,7 @@ module Rails end def internal? - path =~ %r{/rails/info/properties|^/assets} + path =~ %r{/rails/info/properties|^#{Rails.application.config.assets.prefix}} end def engine? diff --git a/railties/test/application/route_inspect_test.rb b/railties/test/application/route_inspect_test.rb index fcfa87e395..7c0a379112 100644 --- a/railties/test/application/route_inspect_test.rb +++ b/railties/test/application/route_inspect_test.rb @@ -8,6 +8,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 +149,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 |