Easier testing of AngularJS promises