From b3403cd593dd01c489f71a6c1d1f0629f2d2ed83 Mon Sep 17 00:00:00 2001 From: toshimaru Date: Sat, 22 Jun 2024 08:40:10 +0900 Subject: [PATCH] docs: Use `perform_enqueued_jobs` in an example code `perform_jobs` should be `perform_enqueued_jobs`, so I fix the example codes. ref. https://guides.rubyonrails.org/testing.html#testing-jobs-in-isolation --- lib/rspec/rails/matchers/active_job.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/rspec/rails/matchers/active_job.rb b/lib/rspec/rails/matchers/active_job.rb index 4d15b492e..7e1d97e26 100644 --- a/lib/rspec/rails/matchers/active_job.rb +++ b/lib/rspec/rails/matchers/active_job.rb @@ -413,33 +413,33 @@ def have_been_enqueued # # @example # expect { - # perform_jobs { HeavyLiftingJob.perform_later } + # perform_enqueued_jobs { HeavyLiftingJob.perform_later } # }.to have_performed_job # # expect { - # perform_jobs { + # perform_enqueued_jobs { # HelloJob.perform_later # HeavyLiftingJob.perform_later # } # }.to have_performed_job(HelloJob).exactly(:once) # # expect { - # perform_jobs { 3.times { HelloJob.perform_later } } + # perform_enqueued_jobs { 3.times { HelloJob.perform_later } } # }.to have_performed_job(HelloJob).at_least(2).times # # expect { - # perform_jobs { HelloJob.perform_later } + # perform_enqueued_jobs { HelloJob.perform_later } # }.to have_performed_job(HelloJob).at_most(:twice) # # expect { - # perform_jobs { + # perform_enqueued_jobs { # HelloJob.perform_later # HeavyLiftingJob.perform_later # } # }.to have_performed_job(HelloJob).and have_performed_job(HeavyLiftingJob) # # expect { - # perform_jobs { + # perform_enqueued_jobs { # HelloJob.set(wait_until: Date.tomorrow.noon, queue: "low").perform_later(42) # } # }.to have_performed_job.with(42).on_queue("low").at(Date.tomorrow.noon)