search for: santasmailbox

Displaying 1 result from an estimated 1 matches for "santasmailbox".

2007 Dec 13
16
"Tricks" for testing after_create callback???
.... Here''s my spec describe Message, "from anyone" do it "should be sent on save" do msg_creation_parms = { :subject => "Subj", :body => "hi", :sender => people(:rick), :recipient => people(:john) } SantasMailbox.should_receive(:deliver_secret_santa).with(Message.new(msg_creation_parms)) Message.create(msg_creation_parms) end end This fails, but only because the model object has an id and time stamps assigned as it''s saved. Spec::Mocks::MockExpectationError in ''Message from anyone...