Hey David,

Just so you can better visualize the interplay here, I put selected segments of my model and spec in a gist:

  https://gist.github.com/b1eac83fecf3219dd534

You can see how active_flash_sale_discount is called immediately within min_money(:force), and how my expectation happens just before I call min_money. So I fail to see how it could have been swapped with another instance not bearing the expectation.

In the end the original active_flash_sale_discount method is called, returning no discount, and my test tanks.

I think I'll just fix this by actually injecting the proper models in there and not rely on expectations instead (which won't let me confirm the method WAS called, but getting the proper final result will be enough). Still, I'd love to understand what gives here.

Best,

--
Christophe Porteneuve
Directeur technique, Ciblo.net
[email protected]

--
You received this message because you are subscribed to the Google Groups 
"rspec" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rspec?hl=en.

Reply via email to