Sha256: 328156a5a7686dce2690521003d43f6c854e31f2060c6bb1e144bf88b17c718b

Contents?: true

Size: 660 Bytes

Versions: 1

Compression:

Stored size: 660 Bytes

Contents

require 'spec_helper'

describe ThinkingSphinx::Deltas::ResqueDelta do
  before :each do
    Resque.redis = MockRedis.new
  end

  describe '.cancel_jobs' do
    subject { ThinkingSphinx::Deltas::ResqueDelta.cancel_jobs }

    before :all do
      class RandomJob
        @queue = 'ts_delta'
      end
    end

    before :each do
      Resque.enqueue(ThinkingSphinx::Deltas::ResqueDelta::DeltaJob, 'foo_delta')
      Resque.enqueue(ThinkingSphinx::Deltas::ResqueDelta::FlagAsDeletedJob, 'bar_delta')
      Resque.enqueue(RandomJob, '1234')
    end

    it 'should remove all jobs' do
      subject
      Resque.size('ts_delta').should eq(0)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ts-resque-delta-2.0.0 spec/thinking_sphinx/deltas/resque_delta_spec.rb