[rspec-users] stub with assigns?

Jonathan Linowes jonathan at parkerhill.com
Thu Dec 13 02:00:12 EST 2007

is there a way to stub a method that sets an instance variable, so  
the stub sets it too?

def find_foo
   @foo = Foo.find(params[:id]

controller.stub!(:find_foo).and_assigns(:foo, "123")

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20071213/2042719f/attachment.html 

More information about the rspec-users mailing list