Sha256: 97aaa59ba14d3b7d67421d94c28b575177ee0d81e0f80b2361384b38c625db85

Contents?: true

Size: 506 Bytes

Versions: 17

Compression:

Stored size: 506 Bytes

Contents

require "spec_helper"

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

17 entries across 17 versions & 1 rubygems

Version Path
mongoid-0.10.6 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.10.5 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.10.4 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.10.3 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.10.2 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.10.1 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.10.0 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.9.12 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.9.11 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.9.10 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.9.9 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.9.8 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.9.7 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.9.6 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.9.5 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.9.4 spec/unit/mongoid/commands/destroy_all_spec.rb
mongoid-0.9.3 spec/unit/mongoid/commands/destroy_all_spec.rb