instance method find_matching_job

Ruby on Rails edge

Since edge Private — implementation detail, not part of the public API

Signature

find_matching_job(jobs, expected_args, job)

No documentation comment.

Parameters

jobs req
expected_args req
job req
Source
# File activejob/lib/active_job/test_helper.rb, line 750
      def find_matching_job(jobs, expected_args, job)
        potential_matches = []

        matching_job = jobs.find do |enqueued_job|
          deserialized_job = deserialize_args_for_assertion(enqueued_job)
          potential_matches << deserialized_job

          expected_args.all? do |key, value|
            if value.respond_to?(:call)
              value.call(deserialized_job[key])
            else
              value == deserialized_job[key]
            end
          end
        end

        matching_class = potential_matches.select do |enqueued_job|
          enqueued_job["job_class"] == job.to_s
        end

        [matching_job, potential_matches, matching_class]
      end

Defined in activejob/lib/active_job/test_helper.rb line 750 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveJob::TestHelper

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close