Sha256: 2b8d8eba3bf680ce44f19d7ea6e4544111ea04901c97162565eceae8675e3aa3

Contents?: true

Size: 971 Bytes

Versions: 13

Compression:

Stored size: 971 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

13 entries across 13 versions & 2 rubygems

Version Path
ts-resque-delta-1.2.1 spec/flying_sphinx/resque_delta/delta_job_spec.rb
ts-resque-delta-1.2.0 spec/flying_sphinx/resque_delta/delta_job_spec.rb
ryansch-ts-resque-delta-1.1.5.4 spec/flying_sphinx/resque_delta/delta_job_spec.rb
ryansch-ts-resque-delta-1.1.5.4.dev spec/flying_sphinx/resque_delta/delta_job_spec.rb
ryansch-ts-resque-delta-1.1.5.3 spec/flying_sphinx/resque_delta/delta_job_spec.rb
ryansch-ts-resque-delta-1.1.5.2 spec/flying_sphinx/resque_delta/delta_job_spec.rb
ryansch-ts-resque-delta-1.1.5.1 spec/flying_sphinx/resque_delta/delta_job_spec.rb
ts-resque-delta-1.1.5 spec/flying_sphinx/resque_delta/delta_job_spec.rb
ts-resque-delta-1.1.4 spec/flying_sphinx/resque_delta/delta_job_spec.rb
ts-resque-delta-1.1.3 spec/flying_sphinx/resque_delta/delta_job_spec.rb
ts-resque-delta-1.1.2 spec/flying_sphinx/resque_delta/delta_job_spec.rb
ts-resque-delta-1.1.1 spec/flying_sphinx/resque_delta/delta_job_spec.rb
ts-resque-delta-1.1.0 spec/flying_sphinx/resque_delta/delta_job_spec.rb