Q: How do you stub a method call for a rails unit test such that it returns a…

by admin on June 7, 2008

Q: How do you stub a method call for a rails unit test such that it returns a different value the second time it is called?

A:  stubs(:foo).returns(1,2)
returns 1 the first call, 2 the second, etc.

wrote this post.

Leave a Comment