module QueueHelper

Public Instance Methods

check_size_for(matched_jobs, times) click to toggle source
# File lib/activejob_spec/matchers.rb, line 36
def check_size_for(matched_jobs, times)
  if times
    matched_jobs.size == times
  else
    matched_jobs.size > 0
  end
end
find_matching_jobs(actual, expected_args) click to toggle source
# File lib/activejob_spec/matchers.rb, line 26
def find_matching_jobs(actual, expected_args)
  enqueued_jobs.select do |entry|
    match_job(entry, actual) && match_args(expected_args, entry.fetch(:args))
  end
end
queue_size_for(actual) click to toggle source
# File lib/activejob_spec/matchers.rb, line 32
def queue_size_for(actual)
  enqueued_jobs.select { |job| match_job(job, actual) }.size
end