Forum: Ruby on Rails Test Confusion

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
ryan.wood (Guest)
on 2005-11-27 20:37
(Received via mailing list)
Hi all,

I am getting a different test result depending if I run the test case
directly versus running via "rake test_functional".

When running directly I get:

>ruby test/functional/admin/account_controller_test.rb
Loaded suite test/functional/admin/account_controller_test
Finished in 0.25 seconds.

4 tests, 12 assertions, 0 failures, 0 errors

Yet when I use "rake test_functional", the first error I get is this:

Finished in 0.797 seconds.

  1) Failure:
<:user> is not in the session <#<ActionController::TestSession:0x350ec50
 @attributes={"flash"=>{:notice=>"Login unsuccessful."}}>>

Don't know if this has anything to do with it, but I'm getting a lot
of these errors as well:

  2) Error:
NoMethodError: You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.-

I'm on Rail 0.14.3. Any help is greatly appreciated.

jerrett (Guest)
on 2005-11-28 19:31
(Received via mailing list)
make sure your class names in
functional/admin/account_controller_test.rb and
functional/account_controller_test.rb are not the same

or for that matter, make sure none of your tests have the same class
This topic is locked and can not be replied to.