disabling transactional fixtures in Rspec has no effect
Posted
by
Dia
on Stack Overflow
See other posts from Stack Overflow
or by Dia
Published on 2011-01-05T05:45:09Z
Indexed on
2011/01/05
5:53 UTC
Read the original article
Hit count: 244
Due to a legacy database I'm using, I'm stuck with MySQL using MyISAM, which means my tables don't support transactions. This is causing the tests to fail, since table data generated (I'm using factory_girl for fixtures) by the tests are not reverted for each scenario.
I discovered that Rspec exposes the config.use_transactional_fixtures
config setting in spec_helper.rb.
which is set to true by default. When I set it to false, I don't see any effect on my tests; they still fail due to duplicate records.
Isn't that setting supposed to automatically unroll any changes made to the DB? Or am I supposed to do that manually?
© Stack Overflow or respective owner