instance method jobs_with

Ruby on Rails 8.0.4

Since v6.0.6 Private

Available in: v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

jobs_with(jobs, only: nil, except: nil, queue: nil, at: nil)

No documentation comment.

Parameters

jobs req
only key = nil
except key = nil
queue key = nil
at key = nil
Source
# File activejob/lib/active_job/test_helper.rb, line 684
      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 684 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveJob::TestHelper

Type at least 2 characters to search.

↑↓ navigate · open · esc close