redding/mr — pull request #173 by jcredding (2014-01-27 21:46:49+00:00)
Title: Add `model_reset_save_called` to test helpers

This is an additional helper for manually resetting a fake record
`save_called` flag via a model. This should be used when manually
saving a model in a test and then using `assert_model_saved`. This
avoids false-positive tests. If you manually save the model, then
it its `save_called` flag will be `true`. Then any assertions using
`assert_model_saved` will always pass. This allows you to easily
reset the state so that those tests will properly fail. This does
the same thing the stacks do, it can just be called when a model
is saved outside a stack.

@kellyredding - Ran into this in our large app when we tested a model being saved when it was "new" and when it was "existing" next to each other. The model would be manually saved outside of a stack.