On Jan 11, 2008, at 5:54 PM, Ben Mabey <[EMAIL PROTECTED]> wrote:

> David Chelimsky wrote:
>>
>>
>> In TDD there is a rule of thumb that says don't stub a method in the
>> same class as the method you're testing. The risk is that as the real
>> implementation of by_input_sets!() changes over time, it has access  
>> to
>> internal state that could impact the behaviour of decompose!().
>>
>
>
> So, stubbing a current_user method on a rails controller would be
> considered bad practice?
> I suppose stubbing the find on User would be just as easy but I have
> always just stubbed controller.current_user.
>

In my login_as helper, I just call controller.send(:current_user=,  
user). No need to stub anything.

//jarkko

> -Ben
> _______________________________________________
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to