@@ -12,9 +12,6 @@ describe('angular.scenario.Application', function() {
12
12
beforeEach ( function ( ) {
13
13
frames = _jQuery ( "<div></div>" ) ;
14
14
app = new angular . scenario . Application ( frames ) ;
15
- app . checkUrlStatus_ = function ( url , callback ) {
16
- callback . call ( this ) ;
17
- } ;
18
15
} ) ;
19
16
20
17
it ( 'should return new $window and $document after navigate' , function ( ) {
@@ -82,15 +79,6 @@ describe('angular.scenario.Application', function() {
82
79
expect ( called ) . toBeTruthy ( ) ;
83
80
} ) ;
84
81
85
- it ( 'should call error handler if status check fails' , function ( ) {
86
- app . checkUrlStatus_ = function ( url , callback ) {
87
- callback . call ( this , 'Example Error' ) ;
88
- } ;
89
- app . navigateTo ( 'http://localhost/' , angular . noop , function ( error ) {
90
- expect ( error ) . toEqual ( 'Example Error' ) ;
91
- } ) ;
92
- } ) ;
93
-
94
82
it ( 'should hide old iframes and navigate to about:blank' , function ( ) {
95
83
app . navigateTo ( 'http://localhost/#foo' ) ;
96
84
app . navigateTo ( 'http://localhost/#bar' ) ;
@@ -151,67 +139,4 @@ describe('angular.scenario.Application', function() {
151
139
expect ( handlers . length ) . toEqual ( 1 ) ;
152
140
handlers [ 0 ] ( ) ;
153
141
} ) ;
154
-
155
- describe ( 'jQuery ajax' , function ( ) {
156
- var options ;
157
- var response ;
158
- var jQueryAjax ;
159
-
160
- beforeEach ( function ( ) {
161
- response = {
162
- status : 200 ,
163
- statusText : 'OK'
164
- } ;
165
- jQueryAjax = _jQuery . ajax ;
166
- _jQuery . ajax = function ( opts ) {
167
- options = opts ;
168
- opts . complete . call ( this , response ) ;
169
- } ;
170
- app . checkUrlStatus_ = angular . scenario . Application .
171
- prototype . checkUrlStatus_ ;
172
- } ) ;
173
-
174
- afterEach ( function ( ) {
175
- _jQuery . ajax = jQueryAjax ;
176
- } ) ;
177
-
178
- it ( 'should perform a HEAD request to verify file existence' , function ( ) {
179
- app . navigateTo ( 'http://www.google.com/' , angular . noop , angular . noop ) ;
180
- expect ( options . type ) . toEqual ( 'HEAD' ) ;
181
- expect ( options . url ) . toEqual ( 'http://www.google.com/' ) ;
182
- } ) ;
183
-
184
- it ( 'should call error handler if status code is less than 200' , function ( ) {
185
- var finished ;
186
- response . status = 199 ;
187
- response . statusText = 'Error Message' ;
188
- app . navigateTo ( 'http://localhost/' , angular . noop , function ( error ) {
189
- expect ( error ) . toEqual ( '199 Error Message' ) ;
190
- finished = true ;
191
- } ) ;
192
- expect ( finished ) . toBeTruthy ( ) ;
193
- } ) ;
194
-
195
- it ( 'should call error handler if status code is greater than 299' , function ( ) {
196
- var finished ;
197
- response . status = 300 ;
198
- response . statusText = 'Error' ;
199
- app . navigateTo ( 'http://localhost/' , angular . noop , function ( error ) {
200
- expect ( error ) . toEqual ( '300 Error' ) ;
201
- finished = true ;
202
- } ) ;
203
- expect ( finished ) . toBeTruthy ( ) ;
204
- } ) ;
205
-
206
- it ( 'should call error handler if status code is 0 for sandbox error' , function ( ) {
207
- var finished ;
208
- response . status = 0 ;
209
- response . statusText = '' ;
210
- app . navigateTo ( 'http://localhost/' , angular . noop , function ( error ) {
211
- expect ( error ) . toEqual ( 'Sandbox Error: Cannot access http://localhost/' ) ;
212
- finished = true ;
213
- } ) ;
214
- expect ( finished ) . toBeTruthy ( ) ;
215
- } ) ;
216
- } ) ;
217
142
} ) ;
0 commit comments