diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2018-11-23 17:00:45 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-23 17:00:45 -0500 |
commit | 34726ad8959079fea17a2f6ea7fc2bd4864255a6 (patch) | |
tree | 59438a03e8096c5232ff1d43a55c08cc4a307f84 /actionmailer/lib/action_mailer/test_helper.rb | |
parent | 437d20916f80eb905a1c028db4bd53304c293e61 (diff) | |
parent | 60339da5bcb76489576321fa12e665f176d8d692 (diff) | |
download | rails-34726ad8959079fea17a2f6ea7fc2bd4864255a6.tar.gz rails-34726ad8959079fea17a2f6ea7fc2bd4864255a6.tar.bz2 rails-34726ad8959079fea17a2f6ea7fc2bd4864255a6.zip |
Merge pull request #34367 from gmcgibbon/rm_parameterized_delivery_job
Deliver parameterized mail with DeliveryJob
Diffstat (limited to 'actionmailer/lib/action_mailer/test_helper.rb')
-rw-r--r-- | actionmailer/lib/action_mailer/test_helper.rb | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/actionmailer/lib/action_mailer/test_helper.rb b/actionmailer/lib/action_mailer/test_helper.rb index b3403e8331..3eb61c2363 100644 --- a/actionmailer/lib/action_mailer/test_helper.rb +++ b/actionmailer/lib/action_mailer/test_helper.rb @@ -124,15 +124,12 @@ module ActionMailer # end # end def assert_enqueued_email_with(mailer, method, args: nil, queue: "mailers", &block) - if args.is_a? Hash - job = mailer.parameterized_delivery_job - args = [mailer.to_s, method.to_s, "deliver_now", args] + args = if args.is_a?(Hash) + [mailer.to_s, method.to_s, "deliver_now", args] else - job = mailer.delivery_job - args = [mailer.to_s, method.to_s, "deliver_now", *args] + [mailer.to_s, method.to_s, "deliver_now", nil, *args] end - - assert_enqueued_with(job: job, args: args, queue: queue, &block) + assert_enqueued_with(job: mailer.delivery_job, args: args, queue: queue, &block) end # Asserts that no emails are enqueued for later delivery. @@ -159,8 +156,7 @@ module ActionMailer def delivery_job_filter(job) job_class = job.is_a?(Hash) ? job.fetch(:job) : job.class - Base.descendants.map(&:delivery_job).include?(job_class) || - Base.descendants.map(&:parameterized_delivery_job).include?(job_class) + Base.descendants.map(&:delivery_job).include?(job_class) end end end |