[rspec-users] Authenticating before tests

sinclair bain rspec.user at gmail.com
Thu Sep 13 12:52:05 EDT 2007


Hi!
Have you considered mocking / stubbing to test in isolation if that is
appropriate ?

sinclair

On 9/13/07, Luke Galea <galeal_lists at ideaforge.org> wrote:
>
> Hi all,
>
> I'm using Goldberg, an engine that provides roles based access
> control for my app. I need to login before I can do controller tests,
> but I can't find any examples of people doing this.
>
> Could someone point me in the right direction?
>
> I thought the simplest way would be to either call the login action
> from my other tests before(:all), but I can't seem to find how to
> call another controller from within the spec for a different
> controller. (Results in @controller is nil).
>
> I've also tried setting session[:user] in before(:all), but session
> is nil at that point!
>
> Any help would be greatly appreciated.
>
> Thanks,
> Luke
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070913/0e67634b/attachment.html 


More information about the rspec-users mailing list