[Rspec-users] Should fixtures be transactional?
lists-rspec at shopwatch.org
Tue Oct 17 21:39:31 EDT 2006
aslak hellesoy wrote:
> On 10/17/06, Jay Levitt <lists at shopwatch.org> wrote:
>> aslak hellesoy wrote:
>>> So I'm inclined to think this is a Rails bug with sqlite3.
>>> I haven't tried with Test::Unit to see if it behaves the same way.
> I tried with Test::Unit in RSpec's vendor/rspec_on_rails:
> 1) Get the latest svn trunk
> 2) cd vendor/rspec_on_rails
> 3) rake db:migrate db:test:clone ; ruby test/unit/animal_test.rb ;
> echo "select * from animals;" | sqlite3 db/test.db
> I get:
> 1 tests, 1 assertions, 0 failures, 0 errors
> The records are left in the database - even with Test::Unit and
> transactional fixtures ON.
> I'd say it's a Rails bug (I've tried both bleeding edge and 1.1.6). To
> be 100% sure - could you please try to run a Test::Unit test in your
> app and see how it works with that?
Actually, I've just read an article from back when transactional
fixtures first came out, and it seems that this is by design; Rails
commits the fixtures to disk so that it can keep rolling back to that
point. Ah, well. I suppose I prefer to search for the specific records
I've created, not just count the total records, so this will stop me
from being lazy!
More information about the Rspec-users