@@ -55,66 +55,6 @@ describe("Utility", function () {
5555 } ) ;
5656 } ) ;
5757
58- describe ( "ajax" , function ( ) {
59- it ( "should load content from a URL" , function ( done ) {
60- util . ajax ( testHelper . fixture ( "simple.js" ) ) . then ( function ( content ) {
61- expect ( content ) . toEqual ( 'var s = "hello";\n' ) ;
62-
63- done ( ) ;
64- } ) ;
65- } ) ;
66-
67- it ( "should call error callback on fail" , function ( done ) {
68- util . ajax ( testHelper . fixture ( "non_existing_url.html" ) ) . then (
69- null ,
70- function ( ) {
71- done ( ) ;
72- }
73- ) ;
74- } ) ;
75-
76- it ( "should not cache repeated calls by default" , function ( ) {
77- var dateNowSpy = spyOn ( window . Date , "now" ) . and . returnValue ( 42 ) ,
78- ajaxRequest = jasmine . createSpyObj ( "ajaxRequest" , [
79- "open" ,
80- "addEventListener" ,
81- "overrideMimeType" ,
82- "send" ,
83- ] ) ;
84-
85- spyOn ( window , "XMLHttpRequest" ) . and . returnValue ( ajaxRequest ) ;
86-
87- util . ajax ( "non_existing_url.html" ) ;
88-
89- expect ( ajaxRequest . open . calls . mostRecent ( ) . args [ 1 ] ) . toEqual (
90- "non_existing_url.html?_=42"
91- ) ;
92-
93- dateNowSpy . and . returnValue ( 43 ) ;
94- util . ajax ( "non_existing_url.html" ) ;
95- expect ( ajaxRequest . open . calls . mostRecent ( ) . args [ 1 ] ) . toEqual (
96- "non_existing_url.html?_=43"
97- ) ;
98- } ) ;
99-
100- it ( "should not break existing query parameters" , function ( ) {
101- var ajaxRequest = jasmine . createSpyObj ( "ajaxRequest" , [
102- "open" ,
103- "addEventListener" ,
104- "overrideMimeType" ,
105- "send" ,
106- ] ) ;
107- spyOn ( window . Date , "now" ) . and . returnValue ( 42 ) ;
108- spyOn ( window , "XMLHttpRequest" ) . and . returnValue ( ajaxRequest ) ;
109-
110- util . ajax ( "non_existing_url?someParam=foo" ) ;
111-
112- expect ( ajaxRequest . open . calls . mostRecent ( ) . args [ 1 ] ) . toEqual (
113- "non_existing_url?someParam=foo&_=42"
114- ) ;
115- } ) ;
116- } ) ;
117-
11858 describe ( "loadAsBlob" , function ( ) {
11959 var blob2Text = function ( blob ) {
12060 var defer = ayepromise . defer ( ) ,
0 commit comments