From 64a9759aff949761f1d79b010e4817a91f3ee226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Di=CC=81az?= Date: Tue, 11 Sep 2018 19:38:55 -0500 Subject: 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. --- activejob/lib/active_job/railtie.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activejob') diff --git a/activejob/lib/active_job/railtie.rb b/activejob/lib/active_job/railtie.rb index d0294854d3..ecc0908d5f 100644 --- a/activejob/lib/active_job/railtie.rb +++ b/activejob/lib/active_job/railtie.rb @@ -30,6 +30,10 @@ module ActiveJob send(k, v) if respond_to? k end end + + ActiveSupport.on_load(:action_dispatch_integration_test) do + include ActiveJob::TestHelper + end end initializer "active_job.set_reloader_hook" do |app| -- cgit v1.2.3