Technical deep-dive

Database transactions in RSpec

Weird things under the hood

Duong Nguyen
The Startup
Published in
4 min readJun 19, 2020

--

Photo by fabio on Unsplash

Stale data between test cases is one of the major causes of race conditions in RSpec. This includes data in databases, Redis, files, …

In this article, we would be focusing on how to clean up stale data in databases.

Rails RSpec default…

--

--

Duong Nguyen
The Startup

Engineering Manager@ Rakuten Viki. All opinions are my own.