aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMisko Hevery2011-03-10 14:46:07 -0800
committerMisko Hevery2011-03-11 14:16:53 -0800
commit0084cb5ca4bc9acda54d304147b0b0fe8e1980f3 (patch)
treec64e5aebff8907ebb6af306aa5d9d0fa1062adea /test
parentc578f8c3ed0ca23b03ccde146cb13cfaf24f17cd (diff)
downloadangular.js-0084cb5ca4bc9acda54d304147b0b0fe8e1980f3.tar.bz2
Remove the script tag after successful JSONP request
Diffstat (limited to 'test')
-rw-r--r--test/BrowserSpecs.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/BrowserSpecs.js b/test/BrowserSpecs.js
index 6951783b..3b5a9ba0 100644
--- a/test/BrowserSpecs.js
+++ b/test/BrowserSpecs.js
@@ -85,12 +85,16 @@ describe('browser', function(){
browser.notifyWhenNoOutstandingRequests(callback);
expect(callback).not.wasCalled();
expect(scripts.length).toEqual(1);
- var url = scripts[0].src.split('?cb=');
+ var script = scripts[0];
+ script.remove = function(){
+ log += 'remove();';
+ };
+ var url = script.attr('src').split('?cb=');
expect(url[0]).toEqual('http://example.org/path');
expect(typeof fakeWindow[url[1]]).toEqual($function);
fakeWindow[url[1]]('data');
expect(callback).wasCalled();
- expect(log).toEqual('200:data;');
+ expect(log).toEqual('remove();200:data;');
expect(typeof fakeWindow[url[1]]).toEqual('undefined');
});
});