aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng/qSpec.js
diff options
context:
space:
mode:
authorIgor Minar2012-04-02 10:10:46 -0700
committerIgor Minar2012-04-02 10:14:04 -0700
commitc0b78478a0e64942a69aba7c1bfa4eb01c0e9a5e (patch)
tree3130c15a619d9aa20ec6b2188ef7e4e25bee1d13 /test/ng/qSpec.js
parent59fa40ec0e851759d35fb0ea5fd01019d1403049 (diff)
downloadangular.js-c0b78478a0e64942a69aba7c1bfa4eb01c0e9a5e.tar.bz2
fix($q): $q.reject should forward callbacks if missing
$q.reject('some reason').then() should not blow up, but correctly forward the callbacks instead. Closes #845
Diffstat (limited to 'test/ng/qSpec.js')
-rw-r--r--test/ng/qSpec.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ng/qSpec.js b/test/ng/qSpec.js
index a230d1de..941b4f2e 100644
--- a/test/ng/qSpec.js
+++ b/test/ng/qSpec.js
@@ -480,6 +480,14 @@ describe('q', function() {
syncResolve(deferred, rejectedPromise);
expect(log).toEqual(['error(Error: not gonna happen)']);
});
+
+
+ it('should return a promise that forwards callbacks if the callbacks are missing', function() {
+ var rejectedPromise = q.reject('rejected');
+ promise.then(success(), error());
+ syncResolve(deferred, rejectedPromise.then());
+ expect(log).toEqual(['error(rejected)']);
+ });
});