Sha256: 5e4ace5e64da46db8f4c0e620a3f708409614f56fb1893f8047f81d5478925f3

Contents?: true

Size: 872 Bytes

Versions: 1

Compression:

Stored size: 872 Bytes

Contents

require 'spec_helper'
require 'sidekiq/testing'

describe "ActiveJob with Sidekiq backend" do
  if defined? ActiveJob
    before :each do
      DelayedPaperclip.options[:background_job_class] = DelayedPaperclip::Jobs::ActiveJob
      ActiveJob::Base.logger = nil
      ActiveJob::Base.queue_adapter = :sidekiq
      Sidekiq::Queues["paperclip"].clear
    end

    let(:dummy) { Dummy.new(:image => File.open("#{ROOT}/spec/fixtures/12k.png")) }

    describe "integration tests" do
      include_examples "base usage"
    end
  end

  def process_jobs
    Sidekiq::Queues["paperclip"].each do |job|
      worker = job["class"].constantize.new
      args   = job["args"]
      begin
        worker.perform(*args)
      rescue # Assume sidekiq handle exception properly
      end
    end
  end

  def jobs_count(queue = "paperclip")
    Sidekiq::Queues[queue].size
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
delayed_paperclip-2.9.2 spec/integration/active_job_sidekiq_spec.rb