Sha256: 7c391f19a695612a4e940e5e8a74c65c5086845b698583a067aa4890759c6c21

Contents?: true

Size: 554 Bytes

Versions: 24

Compression:

Stored size: 554 Bytes

Contents

require File.join(File.dirname(__FILE__), "/../../../spec_helper.rb")

describe Mongoid::Commands::DestroyAll 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::Destroy.expects(:execute).with(@doc)
      Mongoid::Commands::DestroyAll.execute(@klass, @conditions)
    end

  end

end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
mongoid-0.6.4 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.6.3 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.6.2 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.6.1 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.6.0 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.5.11 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.5.10 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.5.9 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.5.8 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.5.7 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.5.6 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.5.5 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.5.4 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.5.3 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.5.2 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.5.1 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.5.0 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.4.8 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.4.7 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.4.5 spec/unit/mongoid/commands/destroy_all_spec.rb