# How to test a controller that needs to be logged?

**URL:** <https://www.ruby-forum.com/t/how-to-test-a-controller-that-needs-to-be-logged/166669>\
**Category:** Rails\
**Created:** [April 28, 2009, 1:03pm UTC](https://www.ruby-forum.com/t/how-to-test-a-controller-that-needs-to-be-logged/166669 "2009-04-28T13:03:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kinunt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/7c8e57/32.png) [@kinunt](https://www.ruby-forum.com/u/kinunt)\
**Post date:** [April 28, 2009, 1:03pm UTC](https://www.ruby-forum.com/t/how-to-test-a-controller-that-needs-to-be-logged/166669/1 "2009-04-28T13:03:50Z")

</div>

Hi,

I know that I should use IntegrationTests to test flows of data. For  
example, when an action requires various controllers. My question is, if  
I can’t post to another controller from for example  
organizacions\_controller\_test.rb, how I can test its actions if those  
actions require to be logged?

I can’t post ‘users/login’, :user =\> {…}  
I can’t post {:controller =\> ‘users’, :action=\>‘login’}, :user =\>{…}

etc…

Thanks.
