fix incorrect usage of sinon spys - test are currently broken