instance method
jobs_with
Ruby on Rails 7.1.6
Since v6.0.6 PrivateSignature
jobs_with(jobs, only: nil, except: nil, queue: nil, at: nil)
No documentation comment.
Parameters
-
jobsreq -
onlykey = nil -
exceptkey = nil -
queuekey = nil -
atkey = nil
Source
# File activejob/lib/active_job/test_helper.rb, line 661
def jobs_with(jobs, only: nil, except: nil, queue: nil, at: nil)
validate_option(only: only, except: except)
jobs.dup.select do |job|
job_class = job.fetch(:job)
if only
next false unless filter_as_proc(only).call(job)
elsif except
next false if filter_as_proc(except).call(job)
end
if queue
next false unless queue.to_s == job.fetch(:queue, job_class.queue_name)
end
if at && job[:at]
next false if job[:at] > at.to_f
end
yield job if block_given?
true
end
end
Defined in activejob/lib/active_job/test_helper.rb line 661
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveJob::TestHelper