Sha256: 94ef3499dba0d0f80e9a784a5ac344b515ef317651567cdd0c582107267f4566

Contents?: true

Size: 910 Bytes

Versions: 6

Compression:

Stored size: 910 Bytes

Contents

require 'spec_helper'
require 'resque'

describe "Resque" do

  before :all do
    DelayedPaperclip.options[:background_job_class] = DelayedPaperclip::Jobs::Resque
    Resque.remove_queue(:paperclip)
  end

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

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

  describe "perform job" do
    before :each do
      DelayedPaperclip.options[:url_with_processing] = true
      reset_dummy
    end

    it "performs a job" do
      dummy.image = File.open("#{ROOT}/spec/fixtures/12k.png")
      Paperclip::Attachment.any_instance.expects(:reprocess!)
      dummy.save!
      DelayedPaperclip::Jobs::Resque.perform(dummy.class.name, dummy.id, :image)
    end
  end

  def process_jobs
    worker = Resque::Worker.new(:paperclip)
    worker.process
  end

  def jobs_count
    Resque.size(:paperclip)
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
delayed_paperclip-2.9.1 spec/integration/resque_spec.rb
delayed_paperclip-2.9.0 spec/integration/resque_spec.rb
delayed_paperclip-2.8.0 spec/integration/resque_spec.rb
delayed_paperclip-2.7.1 spec/integration/resque_spec.rb
delayed_paperclip-2.7.0 spec/integration/resque_spec.rb
delayed_paperclip-2.6.1 spec/integration/resque_spec.rb