Sha256: 1031daf3c59d6eff8c8aef00765f951fd83cde828238ffb2eb62eada9fffc3aa

Contents?: true

Size: 937 Bytes

Versions: 3

Compression:

Stored size: 937 Bytes

Contents

require 'spec_helper'

describe FlyingSphinx::ResqueDelta::DeltaJob do
  describe '@queue' do
    it "uses the fs_delta queue" do
      FlyingSphinx::ResqueDelta::DeltaJob.instance_variable_get(:@queue).
        should == :fs_delta
    end
  end

  describe '.perform' do
    it "doesn't create an index request when skipping" do
      FlyingSphinx::ResqueDelta::DeltaJob.stub!(:skip? => true)

      FlyingSphinx::IndexRequest.should_not_receive(:new)

      FlyingSphinx::ResqueDelta::DeltaJob.perform 'foo_delta'
    end

    it "performs an index request when not skipping" do
      request = double('index request', :perform => true)
      FlyingSphinx::ResqueDelta::DeltaJob.stub!(:skip? => false)

      FlyingSphinx::IndexRequest.should_receive(:new).
        with(['foo_delta']).
        and_return(request)
      request.should_receive(:perform)

      FlyingSphinx::ResqueDelta::DeltaJob.perform 'foo_delta'
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ts-resque-delta-1.2.4 spec/flying_sphinx/resque_delta/delta_job_spec.rb
ts-resque-delta-1.2.3 spec/flying_sphinx/resque_delta/delta_job_spec.rb
ts-resque-delta-1.2.2 spec/flying_sphinx/resque_delta/delta_job_spec.rb