Sha256: 55311a94d51f8044a40c4f13fdadef856f6298785e89d137b1a7791918c05fbe
Contents?: true
Size: 880 Bytes
Versions: 2
Compression:
Stored size: 880 Bytes
Contents
require File.dirname(__FILE__) + '/spec_helper' describe 'searchable with lifecycle' do integrate_sunspot describe 'on create' do before :each do @post = PostWithAuto.create Sunspot.commit end it 'should automatically index' do PostWithAuto.search.results.should == [@post] end end describe 'on update' do before :each do @post = PostWithAuto.create @post.update_attributes(:title => 'Test 1') Sunspot.commit end it 'should automatically update index' do PostWithAuto.search { with :title, 'Test 1' }.results.should == [@post] end end describe 'on destroy' do before :each do @post = PostWithAuto.create @post.destroy Sunspot.commit end it 'should automatically remove it from the index' do PostWithAuto.search_ids.should be_empty end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
kuahyeow-sunspot_rails-0.10.7 | spec/model_lifecycle_spec.rb |
kuahyeow-sunspot_rails-0.10.6 | spec/model_lifecycle_spec.rb |