Skip to content

Commit 17e6ae6

Browse files
Fix argument passing
1 parent 8375228 commit 17e6ae6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/rspec/rails/matchers/have_enqueued_mail.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def arguments_match?(job)
9191

9292
def process_arguments(job, given_mail_args)
9393
# Old matcher behavior working with all builtin classes but ActionMailer::MailDeliveryJob
94-
return given_mail_args if use_given_mail_args?
94+
return given_mail_args if use_given_mail_args?(job)
9595

9696
# If matching args starts with a hash and job instance has params match with them
9797
if given_mail_args.first.is_a?(Hash) && job[:args][3]['params'].present?
@@ -101,7 +101,7 @@ def process_arguments(job, given_mail_args)
101101
end
102102
end
103103

104-
def use_given_mail_args?
104+
def use_given_mail_args?(job)
105105
return false if rails_6_1_and_ruby_3_1?
106106

107107
!(defined?(ActionMailer::MailDeliveryJob) && job[:job] <= ActionMailer::MailDeliveryJob)

0 commit comments

Comments
 (0)