Skip to content

Commit 1e89f41

Browse files
author
Joel Lubrano
committed
Fix ActiveJob::Base.queue_adapter error
When using the HaveEnqueuedMail matcher, the error message should not complain about using "ActiveJob" matchers.
1 parent 6330850 commit 1e89f41

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

lib/rspec/rails/matchers/have_enqueued_mail.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ def mail_job_message(job)
201201
# MyMailer.welcome(user).deliver_later(queue: :urgent_mail)
202202
# }.to have_enqueued_mail(MyMailer, :welcome).on_queue(:urgent_mail)
203203
def have_enqueued_mail(mailer_class, mail_method_name)
204-
check_active_job_adapter
205204
HaveEnqueuedMail.new(mailer_class, mail_method_name)
206205
end
207206
alias_method :have_enqueued_email, :have_enqueued_mail

spec/rspec/rails/matchers/have_enqueued_mail_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def email_with_optional_args(required_arg, optional_arg = nil); end
238238

239239
expect {
240240
expect { TestMailer.test_email.deliver_later }.to have_enqueued_mail(TestMailer, :test_email)
241-
}.to raise_error("To use ActiveJob matchers set `ActiveJob::Base.queue_adapter = :test`")
241+
}.to raise_error("To use HaveEnqueuedMail matcher set `ActiveJob::Base.queue_adapter = :test`")
242242

243243
ActiveJob::Base.queue_adapter = queue_adapter
244244
end

0 commit comments

Comments
 (0)