For my Rails project, I use custom code to setup my database before each test. This is a lot of data, and it takes about 2 seconds every time. This data is the same for every test, so I want to avoid doing this setup on every test.
Rails has transactional fixtures, which rolls back the database to the state it was in before the test, but after the Rails fixtures. My issue is that it is also rolled back to the state it was in before my setup data was created.
Is there a way to prevent the transactional fixtures from rolling back my setup code? I assume I have to run my setup code sometime before the transaction is started, but where would this be?