Fixtures surviving from unit tests to functional tests


#1

Hi list,

I’m having a little problem with fixtures and functional tests. It seems
that the fixtures that get’s loaded by the unit tests aren’t deleted
when the functional tests starts running. Now IMHO this is not good as
it means I can get different test results from running all tests and
only functional tests. Am I missing something or should I report this
bug to the dev’s? I can’t seem to find anything about it in the issue
tracker.


#2

Hi !

2005/12/5, Jacob A. removed_email_address@domain.invalid:

I’m having a little problem with fixtures and functional tests. It seems
that the fixtures that get’s loaded by the unit tests aren’t deleted
when the functional tests starts running. Now IMHO this is not good as
it means I can get different test results from running all tests and
only functional tests. Am I missing something or should I report this
bug to the dev’s? I can’t seem to find anything about it in the issue
tracker.

This is normal and expected. When a test executes #teardown, it does
not delete the DB content. If you use transactional fixtures,
#teardown will ROLLBACK the transaction, but beyond that, nothing will
be done with the DB.

If you need empty fixtures in your functional tests, you’ll need to
ensure that yourself - #setup should be changed to do it, or do it in
test/test_helper.rb

Hope that helps !