Specs on private methods

On Jan 11, 2008, at 5:54 PM, Ben M. [email protected] wrote:

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs