Displaying 1 result from an estimated 1 matches for "msg_creation_parm".
Did you mean:
msg_creation_parms
2007 Dec 13
16
"Tricks" for testing after_create callback???
...ods on the
message model to render the email.
So the natural way to do this is in an after_create callback on the
Message model.
But I can''t see an easy way to test this. 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
e...