testing promises spy and provide