# Functional tests fail with acts\_as\_authenticated installed

**URL:** <https://www.ruby-forum.com/t/functional-tests-fail-with-acts-as-authenticated-installed/89138>\
**Category:** Rails\
**Created:** [March 17, 2007, 6:52pm UTC](https://www.ruby-forum.com/t/functional-tests-fail-with-acts-as-authenticated-installed/89138 "2007-03-17T18:52:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![threeeyedfish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a587f6/32.png) [@threeeyedfish](https://www.ruby-forum.com/u/threeeyedfish)\
**Post date:** [March 17, 2007, 6:52pm UTC](https://www.ruby-forum.com/t/functional-tests-fail-with-acts-as-authenticated-installed/89138/1 "2007-03-17T18:52:39Z")

</div>

Hi, all!  
How can I fake authentication within a functional test?  
The problem is, after I’ve installed acts\_as\_authenticated all requests  
in my functional test are (correctly) redirected to login screen  
because test “user” is not logged in.  
I need to “log in” in functional test setup method, but have no ideas  
about that.  
Help me please.

Yours sincerely,  
Damian/Three-eyed Fish

---

<div class="post-metadata">

**Author:** ![threeeyedfish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a587f6/32.png) [@threeeyedfish](https://www.ruby-forum.com/u/threeeyedfish)\
**Post date:** [March 17, 2007, 9:10pm UTC](https://www.ruby-forum.com/t/functional-tests-fail-with-acts-as-authenticated-installed/89138/2 "2007-03-17T21:10:56Z")

</div>

Hi, did you add a valid user and it’s crenditials to the relevant  
model’s fixture? In any case, please post your relevant test and  
associated fixtures file and we can better assist you.

-Conrad

---

<div class="post-metadata">

**Author:** ![threeeyedfish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a587f6/32.png) [@threeeyedfish](https://www.ruby-forum.com/u/threeeyedfish)\
**Post date:** [March 18, 2007, 7:02am UTC](https://www.ruby-forum.com/t/functional-tests-fail-with-acts-as-authenticated-installed/89138/3 "2007-03-18T07:02:43Z")

</div>

On Mar 17, 2007, at 23:05, Conrad T. wrote:

> Hi, did you add a valid user and it’s crenditials to the relevant  
> model’s fixture? In any case, please post your relevant test and  
> associated fixtures file and we can better assist you.  
> Thank you.  
> Got it.  
> login\_as :some\_vaild\_user  
> makes the trick.

Yours sincerely,  
Damian/Three-eyed Fish
