[rspec-users] Stub activerecord find given instance?

Tom Stuart tom at experthuman.com
Tue Nov 10 09:19:14 EST 2009


On 10 Nov 2009, at 14:08, Saverio Miroddi wrote:
> Is there a clean/simple way of stubbing the activerecord find() for a
> single instance?

MyModel.stub(:find).with(42).and_return(myModel)


More information about the rspec-users mailing list