提交 db65bb5a 编写于 作者: J Joshua Peek

Pull middleware for Rails info from the initializer instead of ActionController

上级 438ff3b5
......@@ -114,7 +114,7 @@ def git_info
end
property 'Middleware' do
ActionController::Dispatcher.middleware.active.map {|middle| middle.inspect }
Rails.configuration.middleware.active.map { |middle| middle.inspect }
end
# The Rails Git revision, if it's checked out into vendor/rails.
......
desc 'Prints out your Rack middleware stack'
task :middleware => :environment do
ActionController::Dispatcher.middleware.active.each do |middleware|
Rails.configuration.middleware.active.each do |middleware|
puts "use #{middleware.inspect}"
end
puts "run ActionController::Dispatcher.new"
puts "run ActionController::Routing::Routes"
end
......@@ -80,11 +80,11 @@ def test_frameworks_exist
end
end
def test_middleware_property
assert property_defined?('Middleware')
end
def test_html_includes_middleware
Rails::Info.module_eval do
property 'Middleware', ['Rack::Lock', 'Rack::Static']
end
html = Rails::Info.to_html
assert html.include?('<tr><td class="name">Middleware</td>')
properties.value_for('Middleware').each do |value|
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册