Sha256: d736f53e3dfddb83c9fa39abda7ce69e098422fff3a962bdf9f12e1db651e821

Contents?: true

Size: 455 Bytes

Versions: 30

Compression:

Stored size: 455 Bytes

Contents

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

describe Mongoid::Commands::Delete do

  describe "#execute" do

    before do
      @collection = mock
      @document = stub(:collection => @collection, :id => "1")
    end

    it "removes the document from its collection" do
      @collection.expects(:remove).with({ :_id => @document.id })
      Mongoid::Commands::Delete.execute(@document)
    end

  end

end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
mongoid-0.9.2 spec/unit/mongoid/commands/delete_spec.rb
mongoid-0.9.1 spec/unit/mongoid/commands/delete_spec.rb
mongoid-0.9.0 spec/unit/mongoid/commands/delete_spec.rb
mongoid-0.8.10 spec/unit/mongoid/commands/delete_spec.rb
mongoid-0.8.9 spec/unit/mongoid/commands/delete_spec.rb
mongoid-0.8.8 spec/unit/mongoid/commands/delete_spec.rb
mongoid-0.8.7 spec/unit/mongoid/commands/delete_spec.rb
mongoid-0.8.6 spec/unit/mongoid/commands/delete_spec.rb
mongoid-0.8.5 spec/unit/mongoid/commands/delete_spec.rb
mongoid-0.8.4 spec/unit/mongoid/commands/delete_spec.rb
mongoid-0.8.3 spec/unit/mongoid/commands/delete_spec.rb
mongoid-0.8.2 spec/unit/mongoid/commands/delete_spec.rb
mongoid-0.8.1 spec/unit/mongoid/commands/delete_spec.rb
mongoid-0.7.10 spec/unit/mongoid/commands/delete_spec.rb
mongoid-0.7.9 spec/unit/mongoid/commands/delete_spec.rb
mongoid-0.7.8 spec/unit/mongoid/commands/delete_spec.rb
mongoid-0.7.7 spec/unit/mongoid/commands/delete_spec.rb
mongoid-0.7.6 spec/unit/mongoid/commands/delete_spec.rb
mongoid-0.7.5 spec/unit/mongoid/commands/delete_spec.rb
mongoid-0.7.4 spec/unit/mongoid/commands/delete_spec.rb