spec/support/helpers/document_finder_stubs.rb in mongomodel-0.2.2 vs spec/support/helpers/document_finder_stubs.rb in mongomodel-0.2.3
- old
+ new
@@ -39,6 +39,12 @@
def should_delete(conditions={})
selector, options = MongoModel::MongoOptions.new(self, :conditions => conditions).to_a
collection.should_receive(:remove).once.with(selector)
yield if block_given?
end
+
+ def should_update(conditions={}, updates={})
+ selector, options = MongoModel::MongoOptions.new(self, :conditions => conditions).to_a
+ collection.should_receive(:update).once.with(selector, { "$set" => updates }, { :multi => true })
+ yield if block_given?
+ end
end