I have a problem with fixtures not being removed between tests and would
like to know if this is expected behavior or not.
For example, say that I have a model Car, and a car.yml fixtures file. I
have two test cases CarTest and DealerTest. In the first test,
I want to use fixtures, so I define it like this:
class CarTest< ActiveSupport::TestCase
test “Car fixtures should have been loaded” do
assert_equal NUMBER_OF_FIXTURES, Car.count
In my second test case, DealerTest, I do not want to use the car
but want to create some of my own.
class DealerTest< ActiveSupport::TestCase
test “No Cars should be in the database” do
assert_equal 0, Car.count
Now, if I run this test individually, it works fine. But if I run it
test:units, it fails. The car fixtures are left over from the previous
Is this how it is supposed to work?