test sample incorporating Q.defer()