Sha256: 3e1b0dee1fd685039abc6ea717301f8354a09cc314f4ce16abf9735b934e2c43
Contents?: true
Size: 855 Bytes
Versions: 15
Compression:
Stored size: 855 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).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).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).returns(@document) Mongoid::Commands::Create.execute(@document).should == @document end end end
Version data entries
15 entries across 15 versions & 1 rubygems