Skip to content

Commit

Permalink
Merge pull request #2770 from toshimaru/use-perform_enqueued_jobs
Browse files Browse the repository at this point in the history
docs: Use `perform_enqueued_jobs` in an example code
  • Loading branch information
pirj authored and JonRowe committed Jun 24, 2024
1 parent c5db661 commit 95b496b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/rspec/rails/matchers/active_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -384,33 +384,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)
Expand Down

0 comments on commit 95b496b

Please sign in to comment.