Forum: Ruby on Rails testing with loginengine and userengine

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D2b2017098da3e2fd1cdcfbb72ecdbfb?d=identicon&s=25 Jason Edgecombe (Guest)
on 2006-02-08 18:05
(Received via mailing list)
Hi all,

My unit tests and functional tests are failing because my tests aren't
authenticated. I'm using using user engine and login engine.

How can I fake authentication to make my tests work properly.

Thanks,
Jason Edgecombe
15619be638a3ae3d6f86a4995c6484c1?d=identicon&s=25 Dee Zsombor (Guest)
on 2006-02-08 22:00
(Received via mailing list)
Jason Edgecombe wrote:
> My unit tests and functional tests are failing because my tests aren't
> authenticated. I'm using using user engine and login engine.
>
> How can I fake authentication to make my tests work properly.

You'll need to sneak an authenticated user into the session

@request.session[:user] = User.find_by_email("shawn@iridesco.com")

best place for this is the suite's setup method

zsombor
This topic is locked and can not be replied to.