Sha256: 13f526029df11ba77888ade417a39d4ce4508671d9186159b51661b3e2e989e2

Contents?: true

Size: 503 Bytes

Versions: 3

Compression:

Stored size: 503 Bytes

Contents

require "spec_helper"

describe Mongoid::Commands::DeleteAll do

  describe "#execute" do

    before do
      @doc = mock
      @docs = [@doc]
      @klass = mock
      @conditions = { :conditions => { :title => "Sir" } }
    end

    it "destroys each document that the criteria finds" do
      @klass.expects(:find).with(:all, @conditions).returns(@docs)
      Mongoid::Commands::Delete.expects(:execute).with(@doc)
      Mongoid::Commands::DeleteAll.execute(@klass, @conditions)
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mongoid-0.9.5 spec/unit/mongoid/commands/delete_all_spec.rb
mongoid-0.9.4 spec/unit/mongoid/commands/delete_all_spec.rb
mongoid-0.9.3 spec/unit/mongoid/commands/delete_all_spec.rb