add unit tests to ensure that cached records in the database are updated