method

jobs_with

Importance_0
v7.0.0 - Show latest stable - 0 notes - Class: TestHelper
jobs_with(jobs, only: nil, except: nil, queue: nil, at: nil) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activejob/lib/active_job/test_helper.rb, line 647
      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
Register or log in to add new notes.