using a spy to test isFresh