On Dec 12, 2007 11:00 PM, Jonathan Linowes <[EMAIL PROTECTED]> wrote: > > 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] > end > > > ... > controller.stub!(:find_foo).and_assigns(:foo, "123")
huh? I think what you want to be doing is Foo.stub!(:find_foo).and_return @mock_foo and then assigns[:foo] will of course be set to @mock_foo. Pat _______________________________________________ rspec-users mailing list [email protected] http://rubyforge.org/mailman/listinfo/rspec-users
