spec/api/indexer/removal_spec.rb in sunspot-2.1.0 vs spec/api/indexer/removal_spec.rb in sunspot-2.1.1
- old
+ new
@@ -9,13 +9,23 @@
it 'removes an object by type and id' do
session.remove_by_id(Post, 1)
connection.should have_delete('Post 1')
end
- it 'removes an object by type and id and immediately commits' do
- connection.should_receive(:delete_by_id).with(['Post 1']).ordered
+ it 'removes an object by type and ids' do
+ session.remove_by_id(Post, 1, 2)
+ connection.should have_delete('Post 1', 'Post 2')
+ end
+
+ it 'removes an object by type and ids array' do
+ session.remove_by_id(Post, [1, 2])
+ connection.should have_delete('Post 1', 'Post 2')
+ end
+
+ it 'removes an object by type and ids and immediately commits' do
+ connection.should_receive(:delete_by_id).with(['Post 1', 'Post 2', 'Post 3']).ordered
connection.should_receive(:commit).ordered
- session.remove_by_id!(Post, 1)
+ session.remove_by_id!(Post, 1, 2, 3)
end
it 'removes an object from the index and immediately commits' do
connection.should_receive(:delete_by_id).ordered
connection.should_receive(:commit).ordered