diff options
author | yui-knk <spiketeika@gmail.com> | 2016-03-07 11:52:51 +0900 |
---|---|---|
committer | yui-knk <spiketeika@gmail.com> | 2016-03-07 16:48:18 +0900 |
commit | 9a642931fbcc4bab0edffe41d3e7bf59e250e90e (patch) | |
tree | f5faac0c7e4d39a9ef0f22992e4de4961495c9ab /actionmailer/lib/action_mailer | |
parent | af80974f85f8ffb54e7aa2aea8e171f36c3a7ab3 (diff) | |
download | rails-9a642931fbcc4bab0edffe41d3e7bf59e250e90e.tar.gz rails-9a642931fbcc4bab0edffe41d3e7bf59e250e90e.tar.bz2 rails-9a642931fbcc4bab0edffe41d3e7bf59e250e90e.zip |
Prevent not-intended loading of `ActionDispatch::IntegrationTest`
After 9d378747326d26cf1afdac4433ead22967af0984 `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`.
Diffstat (limited to 'actionmailer/lib/action_mailer')
-rw-r--r-- | actionmailer/lib/action_mailer/railtie.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionmailer/lib/action_mailer/railtie.rb b/actionmailer/lib/action_mailer/railtie.rb index 215d0199af..a727ed38e9 100644 --- a/actionmailer/lib/action_mailer/railtie.rb +++ b/actionmailer/lib/action_mailer/railtie.rb @@ -45,9 +45,9 @@ module ActionMailer 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 |