Sha256: 4faebb2f701ab2db19010c38daf6d8eb57f30b6eb16ed5c4b767275a55701192
Contents?: true
Size: 712 Bytes
Versions: 15
Compression:
Stored size: 712 Bytes
Contents
require "spec_helper" describe Mongoid::Commands::Destroy do describe "#execute" do before do @collection = stub_everything @document = stub(:run_callbacks => true, :collection => @collection, :id => "1") end it "runs the before and after destroy callbacks" do @document.expects(:run_callbacks).with(:before_destroy) @document.expects(:run_callbacks).with(:after_destroy) Mongoid::Commands::Destroy.execute(@document) end it "removes the document from its collection" do @collection.expects(:remove).with({ :_id => @document.id }) Mongoid::Commands::Destroy.execute(@document) end end end
Version data entries
15 entries across 15 versions & 1 rubygems