mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Pull middleware for Rails info from the initializer instead of ActionController
This commit is contained in:
parent
438ff3b5b9
commit
db65bb5a31
3 changed files with 7 additions and 7 deletions
|
@ -114,7 +114,7 @@ module Rails
|
|||
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.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
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 @@ EOS
|
|||
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|
|
||||
|
|
Loading…
Reference in a new issue