提交 ff722f9b 编写于 作者: J José Valim

Merge pull request #4469 from guilleiguaran/fix-skipping-assets-in-route-inspector

Don't hardcode assets route skipped in route inspector
......@@ -51,7 +51,7 @@ def action
end
def internal?
path =~ %r{/rails/info/properties|^/assets}
path =~ %r{/rails/info/properties|^#{Rails.application.config.assets.prefix}}
end
def engine?
......
......@@ -8,6 +8,11 @@ class RouteInspectTest < ActiveSupport::TestCase
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 @@ def to_s
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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册