Sha256: 984237c8d8cea7d472dd56098b469d2cf03711f0818f68dfa691410cee6f65d5
Contents?: true
Size: 873 Bytes
Versions: 39
Compression:
Stored size: 873 Bytes
Contents
require "spec_helper" describe Mongoid::Commands::Create do describe "#execute" do before do @document = stub(:run_callbacks) end it "executes a save command" do Mongoid::Commands::Save.expects(:execute).with(@document, true).returns(@document) Mongoid::Commands::Create.execute(@document) end it "runs the before and after create callbacks" do @document.expects(:run_callbacks).with(:before_create) Mongoid::Commands::Save.expects(:execute).with(@document, true).returns(@document) @document.expects(:run_callbacks).with(:after_create) Mongoid::Commands::Create.execute(@document) end it "returns the document" do Mongoid::Commands::Save.expects(:execute).with(@document, true).returns(@document) Mongoid::Commands::Create.execute(@document).should == @document end end end
Version data entries
39 entries across 39 versions & 1 rubygems