Refactor tests to use Purchase.count and Category.count