I’m kinda new to RSpec.
I wanted to run some example Rspec spec ( using rake spec command), having
config.use_transactional_fixtures = false
in configuration file, as it was recommended in some manual.
But, it still wipes the database and it just frustrates me, cause I had sensitive data in it and now it’s all gone. Who the hell actually came up with an idea of clearing the database during the testing ?
How to avoid this behaviour ?
Thanks in advance!
Transactions are there to ensure your test database stays clean so that your tests stay clean and predictable. You should be using them. To turn them off for singular example groups, use
self.use_transactional_fixtures = falseafter the describe line. You will however if you do this need aafter(:each)block that cleans up afterwards.I don’t understand why you have sensitive data in your test database, sounds like you’re doing something wrong there.