Test case for broken counter caches

Counter caches are not updating correctly after a child association is restored. If I try to fix this in the model by using an `after_restore` hook, then a different test case breaks.