Having issues with integration test - responses are always 5

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:

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:inas
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:inrun’]:
expecting <“index”> but rendering with
<“diagnostics.rhtml”>

1 tests, 2 assertions, 1 failures, 0 errors

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs