提交 9a642931 编写于 作者: Y yui-knk

Prevent not-intended loading of `ActionDispatch::IntegrationTest`

After 9d378747 `ActionDispatch::IntegrationTest`
class is loaded and defined in all Rails environments, not only test but also
production. This is not-intended loading of a class which is only used in
test environment.
To prevent not-intended loading, add `ActiveSupport.run_load_hooks` to
`ActionDispatch::IntegrationTest` with `action_dispatch_integration_test` name
and use it in `ActionMailer`.
上级 af80974f
......@@ -45,9 +45,9 @@ class Railtie < Rails::Railtie # :nodoc:
register_observers(options.delete(:observers))
options.each { |k,v| send("#{k}=", v) }
ActionDispatch::IntegrationTest.send :include, ActionMailer::TestCase::ClearTestDeliveries
end
ActiveSupport.on_load(:action_dispatch_integration_test) { include ActionMailer::TestCase::ClearTestDeliveries }
end
initializer "action_mailer.compile_config_methods" do
......
* Add `ActiveSupport.run_load_hooks` to `ActionDispatch::IntegrationTest`
with `action_dispatch_integration_test` name.
*Yuichiro Kaneko*
* Update default rendering policies when the controller action did
not explicitly indicate a response.
......
......@@ -764,5 +764,7 @@ def document_root_element
def self.register_encoder(*args)
Integration::Session::RequestEncoder.register_encoder(*args)
end
ActiveSupport.run_load_hooks(:action_dispatch_integration_test, self)
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册