Sha256: 54de5eb8594e2d5987d7937da379de29da026a27a7ac8965c11fb6678944ccf1

Contents?: true

Size: 841 Bytes

Versions: 15

Compression:

Stored size: 841 Bytes

Contents

require 'test_helper'
require 'base_delayed_paperclip_test'
require 'resque'

class ResquePaperclipTest < Test::Unit::TestCase
  include BaseDelayedPaperclipTest

  def setup
    super
    # Make sure that we just test Resque in here
    DelayedPaperclip.options[:background_job_class] = DelayedPaperclip::Jobs::Resque
    Resque.remove_queue(:paperclip)
  end

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

  def jobs_count
    Resque.size(:paperclip)
  end

  def test_perform_job
    dummy = Dummy.new(:image => File.open("#{RAILS_ROOT}/test/fixtures/12k.png"))
    dummy.image = File.open("#{RAILS_ROOT}/test/fixtures/12k.png")
    Paperclip::Attachment.any_instance.expects(:reprocess!)
    dummy.save!
    DelayedPaperclip::Jobs::Resque.perform(dummy.class.name, dummy.id, :image)
  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
delayed_paperclip-2.8.0 test/resque_paperclip_test.rb
delayed_paperclip-2.7.1 test/resque_paperclip_test.rb
delayed_paperclip-2.7.0 test/resque_paperclip_test.rb
delayed_paperclip-2.6.1 test/resque_paperclip_test.rb
delayed_paperclip-2.6.0.0 test/resque_paperclip_test.rb
delayed_paperclip-2.5.1.0 test/resque_paperclip_test.rb
delayed_paperclip-2.5.0.1 test/resque_paperclip_test.rb
delayed_paperclip-2.4.5.2 test/resque_paperclip_test.rb
delayed_paperclip-2.4.5.1 test/resque_paperclip_test.rb
delayed_paperclip-2.4.5.0 test/resque_paperclip_test.rb
delayed_paperclip-2.4.4.0 test/resque_paperclip_test.rb
delayed_paperclip-2.4.3.0 test/resque_paperclip_test.rb
delayed_paperclip-2.4.2.0 test/resque_paperclip_test.rb
delayed_paperclip-2.4.1.0 test/resque_paperclip_test.rb
delayed_paperclip-2.4.0.0 test/resque_paperclip_test.rb