afterDestroy not called on failed destroy; tests added for other afterXXX handlers on error #249

Merged
merged 2 commits into from Mar 31, 2013

Projects

None yet

2 participants

@scottnonnenberg
Contributor

Added functionality and tests for afterDestroy error cases.

Also added tests for prevention of afterCreate and afterUpdate in error cases, both already implemented.

A thought: what if all of these afterXXX handlers were still called on error, but the model's errors field had been set? That would allow anything set up in beforeCreate to be cleaned up in afterCreate, even if an error happened.

scottnonnenberg added some commits Mar 31, 2013
@scottnonnenberg scottnonnenberg afterDestroy not called on adapter error
Similar to afterCreate and afterUpdate, we don't want to run the afterXXXX handlers if the delete failed according to the adapter.
2ba862f
@scottnonnenberg scottnonnenberg tests only: no afterCreate/afterUpdate on errors
Added tests to ensure that the afterCreate/afterUpdate handlers are not run if the adapter returns an error.
5655e8f
@anatoliychakkaev anatoliychakkaev pushed a commit to anatoliychakkaev/jugglingdb that referenced this pull request Mar 31, 2013
@1602 Add more love to tests, pr #249 f36372b
@1602 1602 merged commit 5655e8f into 1602:master Mar 31, 2013

1 check passed

default The Travis build passed
Details
@protomouse protomouse pushed a commit to minmb/jugglingdb that referenced this pull request May 10, 2013
@1602 + Martin Häger Add more love to tests, pr #249 2221987
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment