Craig D. wrote:
There’s a :purge task in databases.rake in
vendor/rails/railties/lib/tasks. You’ll wan to find a way to avoid
calling that when running tests.
I’m interested to see what ideas others might share.
Leave your test database read-write, and load it up with the
system. Then, in setup(), use Mocha to mock your .save methods (and
whatever internal methods they all call), and raise a fault if anyone
Always think of mocks as a way to “change reality” - to make random dice
crooked, or to change the clock time. Alternately…
Switch the DB to “read-only” in setup() and turn that off in
Either way, experiment by trying to .save from a scratch test, to ensure
system correctly blows up in your face. The point is to make sure at
time it does not!