redding/mr — pull request #155 by jcredding (2014-01-03 21:53:39+00:00)
Title: `FakeRecord`, seperate "changed" attributes and "saved" attributes

When a `FakeRecord` saves, it currently stores changed attributes
in it's `saved_attributes`. This was done in #153 to better
support the MR test helpers. This "broke" the fake records
`_changed?` methods though. They relied on comparing
the current value to what was in `saved_attributes`. Since values
may or may not be in `saved_attributes`, it can't reliably check
if they changed. This fixes this by properly seperating out the
"saved" attributes from the "changed" attributes.

This was found while working on #143. It needs to detect that
the `updated_at` hasn't been changed and, only then, set it to
`Time.now`. I realized that the attribute changed method would
work incorrectly after an empty save. This adds tests to cover
this scenario.