aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVojta Jina2011-08-10 16:03:26 +0200
committerIgor Minar2011-11-30 11:03:42 -0500
commite9b57f9df8eb4aaa2c1657d303c78dc68828091b (patch)
treebb85fffe84a3e6c091e855b9ec202a7a1294ccf5 /test
parent45f47ff6cd264dcd347e6df92c9ef39b0ae8aaba (diff)
downloadangular.js-e9b57f9df8eb4aaa2c1657d303c78dc68828091b.tar.bz2
fix($browser.xhr): respond with internal -2 status on jsonp error
If jsonp is not successfull, we return internal status -2. This internal status should by normalized by $xhr into 0, but $xhr needs to distinguish between jsonp-error/abort/timeout (all status 0).
Diffstat (limited to 'test')
-rw-r--r--test/service/browserSpecs.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/service/browserSpecs.js b/test/service/browserSpecs.js
index 41f17f2a..a3ec6486 100644
--- a/test/service/browserSpecs.js
+++ b/test/service/browserSpecs.js
@@ -147,14 +147,14 @@ describe('browser', function() {
});
- it('should call callback when script fails to load', function() {
+ it('should call callback with status -2 when script fails to load', function() {
browser.xhr('JSONP', 'http://example.org/path?cb=JSON_CALLBACK', null, callback);
var script = scripts[0];
expect(typeof script.onload).toBe('function');
expect(typeof script.onerror).toBe('function');
script.onerror();
- expect(log).toEqual('undefined:undefined;');
+ expect(log).toEqual('-2:undefined;');
});