aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/lib/action_mailer/test_helper.rb
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2018-11-23 17:00:45 -0500
committerGitHub <noreply@github.com>2018-11-23 17:00:45 -0500
commit34726ad8959079fea17a2f6ea7fc2bd4864255a6 (patch)
tree59438a03e8096c5232ff1d43a55c08cc4a307f84 /actionmailer/lib/action_mailer/test_helper.rb
parent437d20916f80eb905a1c028db4bd53304c293e61 (diff)
parent60339da5bcb76489576321fa12e665f176d8d692 (diff)
downloadrails-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.rb14
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