Sha256: 4a94067f256e39a395e7816f2639de4e3e582870d10c45d14bc4c7010f0b14d3
Contents?: true
Size: 600 Bytes
Versions: 39
Compression:
Stored size: 600 Bytes
Contents
require "spec_helper" describe Mongoid::Commands::DestroyAll do describe "#execute" do before do @doc = mock @docs = [@doc] @klass = stub(:name => "Person") @conditions = { :conditions => { :title => "Sir" } } @expected = { :conditions => { :title => "Sir", :_type => "Person" } } end it "destroys each document that the criteria finds" do @klass.expects(:find).with(:all, @expected).returns(@docs) Mongoid::Commands::Destroy.expects(:execute).with(@doc) Mongoid::Commands::DestroyAll.execute(@klass, @conditions) end end end
Version data entries
39 entries across 39 versions & 2 rubygems