From 6620f33ae2ff77afbff78a305767d4d663ed76fa Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 22 Oct 2010 01:07:57 -0700 Subject: [PATCH] fixing spec with a mock on mailer --- spec/models/user/user_friending_spec.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/models/user/user_friending_spec.rb b/spec/models/user/user_friending_spec.rb index 83c1f456a..23444e2d5 100644 --- a/spec/models/user/user_friending_spec.rb +++ b/spec/models/user/user_friending_spec.rb @@ -95,7 +95,9 @@ describe User do end it 'sends an email to the receiving user' do - Notifier.should_receive(:new_request) + mail_obj = mock("mailer") + mail_obj.should_receive(:deliver) + Notifier.should_receive(:new_request).and_return(mail_obj) user.receive @req_xml, person_one end