Forum: Ruby on Rails Fixtures surviving from unit tests to functional tests

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9e7069e091a4c90d1201326d2dca21d1?d=identicon&s=25 jacob (Guest)
on 2005-12-05 21:18
(Received via mailing list)
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.
3dd4b52a0946bd698b1d1635a46ea3a3?d=identicon&s=25 francois.beausoleil (Guest)
on 2005-12-05 21:22
(Received via mailing list)
Hi !

2005/12/5, Jacob Atzen <jacob@aub.dk>:
> 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 !
This topic is locked and can not be replied to.