Problem of using fixture in Rspec
Dear Fellows:
I was using fixtures in the model tests using Rspec. I found that the test data specified in the fixtures was stored in the test database once I ran the spec and won't be removed anyway. Is my observation correct?
There might be another problem regarding the fixtures. When I ran the specs one by one, it was working. However, it failed when I tried to run all the specs in one command. It seemed that the test data which was modified by one spec caused the other spec which accessed that particular data to fail. In other words, the data is actually kind of public to all specs, so the specs shares one copy of test data.
If my observation is correct, are there any ways to overcome these problems? Is it possible that each single spec owns its test data so that the modifications on the data will not affect other specs?
Cheers!