[rspec-users] Setting instance variables for controllers

Scott Taylor mailing_lists at railsnewbie.com
Wed Sep 3 10:53:14 EDT 2008

On Sep 3, 2008, at 10:40 AM, Maurício Linhares wrote:

> You don't need to set the instance variable, you can stub the find  
> call:

Or you could also stub the call to User::find.

Also - you don't *WANT* to set the instance variable - it's an  
encapsulation violation - there is nothing in the public interface  
about it.  Remember, these are not only specs, but *examples*.  Would  
you want someone writing production code modeled off of that spec?


More information about the rspec-users mailing list