# Fixtures surviving from unit tests to functional tests

**URL:** <https://www.ruby-forum.com/t/fixtures-surviving-from-unit-tests-to-functional-tests/49538>\
**Category:** Rails\
**Created:** [December 5, 2005, 9:18pm UTC](https://www.ruby-forum.com/t/fixtures-surviving-from-unit-tests-to-functional-tests/49538 "2005-12-05T21:18:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jacob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f1d935/32.png) [@jacob](https://www.ruby-forum.com/u/jacob)\
**Post date:** [December 5, 2005, 9:18pm UTC](https://www.ruby-forum.com/t/fixtures-surviving-from-unit-tests-to-functional-tests/49538/1 "2005-12-05T21:18:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jacob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f1d935/32.png) [@jacob](https://www.ruby-forum.com/u/jacob)\
**Post date:** [December 5, 2005, 9:22pm UTC](https://www.ruby-forum.com/t/fixtures-surviving-from-unit-tests-to-functional-tests/49538/2 "2005-12-05T21:22:36Z")

</div>

Hi !

2005/12/5, Jacob A. [removed\_email\_address@domain.invalid](mailto: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 !
