ruby on rails 3 - Testing after_create hooks with rspec -


I have a code in my model (ROR 3.0.x) which is less or less like this:

  after_create message of class: if preserved protected def notice? Notifier Message_frame_policies (user, self). Deliver other notifier inventive_message_frame_policies (user, self). Deliver End And End And   

And I'm using the latest RSPC gem. The problem is that I am not able to check the method: If I check it directly then I can not do it because it is protected, if I create a message and set expectations, because it does not work because apparently RSPEP I am not able to catch calls on time.

I have my imagination:

  Description: What should the notification be sent to the entire message by email "U = Factory.Scent (user :: account_type = & gt; ; 1) Message = u.messages.build (: body = & gt; "whatever" ,: author = & gt; "none" ,: email = & gt; "test @ example.com") Notifier.should_receive (Message_from_portfolio) message.save end and   

never received object notifier message_from_portfolio What am I doing wrong? suggestion?

factory Creating the message has already been saved, so it is not being created, just save it from factory.bild and get all correct.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -