I am pretty uncomfortable having this monkey patch in my app given its
scope, so I'm wondering if there might be some way to fix this in
Rails proper. Before putting any time into this I wanted to get Core
feedback as to whether the essence of Mat's solution would be
acceptable, or if you anticipate too many problems, or if there is an
alternate approach worth pursuing...
What's wrong with turning off transactional fixtures in the tests that
check after_commit/after_rollback functionality ? You can check what
you need and clean the db yourself in the test or teardown.
Massive overhead in instantiating the fixtures each time. If I were
to start from scratch I would certainly not depend on a large fixture
set, but at this point we depend on transactional fixtures for
performance.
You can turn transaction fixtures off for an individual set of tests though, and still run the rest of your test suite quickly.
I was actually asking if anyone wanted after_commit/rollback in their tests a few days ago, in the thread about transactional fixture bloating. No-one seemed to be interested though, so I didn't implement it.