I''ve tried to unit test some plain ruby (no rails) code and found that
I
got inexplicable error messages when I ran the test case with rake
test_units. After spending more time on this than I''d like to admit, I
finally realized that TestCase#setup is "enhanced" somewhere in rails.
Disabling this with an empty setup method saved me. Is this behavior
documented somewhere? Should I put my non-model unit tests somewhere
else than in test/unit?
When I run the functional tests generated by login generator, two of
them fail (see at EOM). I don''t think this is expected behavior, or is
it? This is even more surprising as authentication works in my app.
Michael
1) Failure:
test_bad_signup(AccountControllerTest)
[./test/functional/../../config/..//vendor/actionpack/lib/action_controller/deprecated_assertions.rb:116:in
`assert_template_has''
./test/functional/../../config/..//vendor/actionpack/lib/action_controller/deprecated_assertions.rb:194:in
`find_record_in_template''
./test/functional/../../config/..//vendor/actionpack/lib/action_controller/deprecated_assertions.rb:176:in
`assert_invalid_column_on_record''
./test/functional/account_controller_test.rb:44:in
`test_bad_signup'']:
<"user"> is not a template object
2) Failure:
test_signup(AccountControllerTest)
[./test/functional/../../config/..//vendor/actionpack/lib/action_controller/deprecated_assertions.rb:23:in
`assert_session_has''
./test/functional/account_controller_test.rb:35:in `test_signup'']:
<:user> is not in the session
<#<ActionController::TestSession:0xb7868a88
@attributes {:return_to=>
"/account/signup?user=password_confirmationnewpasswordloginnewbobpasswordnewpassword",
"flash"=>{}}>>
--
Michael Schuerig Those people who smile a lot
mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org
Watch the eyes
http://www.schuerig.de/michael/ --Ani DiFranco, Outta Me, Onto You