Recently I had a problem with one of my cucumber scenarios. Certain entries in my test database were disappearing whilst the feature was running. I solved the problem by changing the line
DatabaseCleaner.strategy = :transaction
to
DatabaseCleaner.strategy = :truncation
I'm not sure why that helped. There is a table on the database cleaners gem webpage, but it dosen't really say what the two terms mean. Any help on understanding the difference between the two concepts would be great.
Putting it in a very simple way: truncation removes all data from the database and transaction rollbacks all changes that has been made by the running scenario.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With