convert cache mock to a factory
move cache spy mock into model tests