This used to be a bug (see ticket #197), but I seems to be okay now. I just don't know if it will work on a per test base (probably not). If you want to do this, you can disable transactional fixtures globally by putting config.use_transactional_fixtures = false
on the spec_helper.rb
and use DatabaseCleaner to set that.
I've had a similar problem when testing pages with javascript on the browser (a scenario that does not work with transactional fixtures). Here's how I managed to work around it: http://github.com/lailsonbm/contact_manager_app
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…