Sha256: 3c86831a34992620a7c841e7cd2f772755e40a2bcddc88feb77873d3234e210f

Contents?: true

Size: 565 Bytes

Versions: 9

Compression:

Stored size: 565 Bytes

Contents

require 'acceptance/spec_helper'

describe 'Suspend deltas for a given action', :live => true do
  it "does not update the delta indices until after the block is finished" do
    book = Book.create :title => 'Night Watch', :author => 'Harry Pritchett'
    index

    Book.search('Harry').to_a.should == [book]

    ThinkingSphinx::Deltas.suspend :book do
      book.reload.update_attributes(:author => 'Terry Pratchett')
      sleep 0.25

      Book.search('Terry').to_a.should == []
    end

    sleep 0.25
    Book.search('Terry').to_a.should == [book]
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
thinking-sphinx-3.0.6 spec/acceptance/suspended_deltas_spec.rb
thinking-sphinx-3.0.5 spec/acceptance/suspended_deltas_spec.rb
thinking-sphinx-3.0.4 spec/acceptance/suspended_deltas_spec.rb
thinking-sphinx-3.0.3 spec/acceptance/suspended_deltas_spec.rb
thinking-sphinx-3.0.2 spec/acceptance/suspended_deltas_spec.rb
thinking-sphinx-3.0.1 spec/acceptance/suspended_deltas_spec.rb
thinking-sphinx-3.0.0 spec/acceptance/suspended_deltas_spec.rb
thinking-sphinx-3.0.0.rc spec/acceptance/suspended_deltas_spec.rb
thinking-sphinx-3.0.0.pre spec/acceptance/suspended_deltas_spec.rb