# Having issues with integration test - responses are always 5

**URL:** <https://www.ruby-forum.com/t/having-issues-with-integration-test-responses-are-always-5/104349>\
**Category:** Rails\
**Created:** [May 17, 2007, 12:00am UTC](https://www.ruby-forum.com/t/having-issues-with-integration-test-responses-are-always-5/104349 "2007-05-17T00:00:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![itsaboutprogress](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/6de8d8/32.png) [@itsaboutprogress](https://www.ruby-forum.com/u/itsaboutprogress)\
**Post date:** [May 17, 2007, 12:00am UTC](https://www.ruby-forum.com/t/having-issues-with-integration-test-responses-are-always-5/104349/1 "2007-05-17T00:00:30Z")

</div>

I have a test class for integration testing some operations in my  
application. Im simply trying to test whether a user with role of  
‘user’ can access a specific page in the application which is mapped  
in the database. I can successfully do this if I manually login to the  
application locally and step thru the process. However I get what  
seems to be bizarre errors when running the integration test.

The errors for every method in this test class return either a 500  
error or an error about expecting index but rendering with  
diagnostics.rhtml (?).

I have verified that the test database is in use and the fixtures are  
loaded. I have also verified that the server is running in test mode.  
Below is the integration test method and the stack trace for one test  
case for simplicity.

Any help would be appreciated!  
thanks  
Ryan

# ================ Source

fixtures :users

def test\_should\_allow\_user\_role\_on\_user\_only\_level  
user = users(:john)

```
# need to rename controller. LoginController::login is confusing.
post "/login/login", :username => user.username, :password =>

```

“testpassword”

```
session[:user] = user
assert_not_nil session[:user]

# Try to access a non-protected resource
get '/users/index'
assert_template "index"

```

end

# =========================== Stacktrace:

1. 

Failure:  
test\_should\_allow\_user\_role\_on\_user\_only\_level(UsersTest)  
[c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/  
action\_controller/assertions/response\_assertions.rb:112:in `as sert_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/assertions/response_assertions.rb:109:in`as  
sert\_template’  
users\_test.rb:14:in  
`test_should_allow_user_role_on_user_only_level' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/integration.rb:453:in`run’]:  
expecting \<“index”\> but rendering with  
\<“diagnostics.rhtml”\>

1 tests, 2 assertions, 1 failures, 0 errors
