method
jobs_with
v6.1.3.1 -
Show latest stable
-
0 notes -
Class: TestHelper
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3
- 6.0.0 (0)
- 6.1.3.1 (0)
- 6.1.7.7 (0)
- 7.0.0 (0)
- 7.1.3.2 (0)
- 7.1.3.4 (0)
- What's this?
jobs_with(jobs, only: nil, except: nil, queue: nil, at: nil)
private
Hide source
# File activejob/lib/active_job/test_helper.rb, line 623 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