aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer
diff options
context:
space:
mode:
authorRicardo Díaz <ricardotk002@gmail.com>2018-09-11 19:38:55 -0500
committerRicardo Díaz <ricardotk002@gmail.com>2018-09-12 16:58:14 -0500
commit64a9759aff949761f1d79b010e4817a91f3ee226 (patch)
tree69c1e85183175ab43dabdb304fa9c9d420075efa /actionmailer
parent9e2460393524556ac3aae7e84a0b077055ec1b4d (diff)
downloadrails-64a9759aff949761f1d79b010e4817a91f3ee226.tar.gz
rails-64a9759aff949761f1d79b010e4817a91f3ee226.tar.bz2
rails-64a9759aff949761f1d79b010e4817a91f3ee226.zip
Include test helpers when ActionDispatch::IntegrationTest is loaded
As @dhh brings up, the point of `ActionDispatch::IntegrationTest` is to allow users to test the integration of all the pieces called by a controller. Asserting about the emails and jobs queued is part of that task. This commit includes the `ActionMailer::TestHelper` and `ActiveJob::TestHelper` modules when the ActionMailer and ActiveJob railties are initialized respectively.
Diffstat (limited to 'actionmailer')
-rw-r--r--actionmailer/lib/action_mailer/railtie.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/actionmailer/lib/action_mailer/railtie.rb b/actionmailer/lib/action_mailer/railtie.rb
index 69578471b0..bb6141b406 100644
--- a/actionmailer/lib/action_mailer/railtie.rb
+++ b/actionmailer/lib/action_mailer/railtie.rb
@@ -49,7 +49,10 @@ module ActionMailer
options.each { |k, v| send("#{k}=", v) }
end
- ActiveSupport.on_load(:action_dispatch_integration_test) { include ActionMailer::TestCase::ClearTestDeliveries }
+ ActiveSupport.on_load(:action_dispatch_integration_test) do
+ include ActionMailer::TestHelper
+ include ActionMailer::TestCase::ClearTestDeliveries
+ end
end
initializer "action_mailer.compile_config_methods" do