On Tue, Nov 23, 2010 at 1:04 PM, Raghu Somaraju <somar...@gmail.com> wrote: > > Thank you Robert. That works. I should have used the "current_user" instead > of @_current_user in the first place. > > But, if I do want to use @_current_user, how do I pass on that instance > variable to the controller from spec?
Short answer: Do not do it: Mocking is here to simulate behavior and ivars are here to implement state. (caching state in our case) Long answer: Although I believe that the above said is often true there must be exceptions, I adapted a relish test to show you how it works: https://gist.github.com/711904 Cheers Robert _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users