Sha256: ba92d0ad50321d888e158b1d039ee2ca3c413cf27a445fc446f79b39b55dc3d3
Contents?: true
Size: 903 Bytes
Versions: 24
Compression:
Stored size: 903 Bytes
Contents
require File.join(File.dirname(__FILE__), "/../../../spec_helper.rb") 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
24 entries across 24 versions & 1 rubygems