@@ -1308,7 +1308,7 @@ describe("resource", function() {
1308
1308
} ) ;
1309
1309
1310
1310
describe ( 'resource' , function ( ) {
1311
- var $httpBackend , $resource , $q ;
1311
+ var $httpBackend , $resource ;
1312
1312
1313
1313
beforeEach ( module ( function ( $exceptionHandlerProvider ) {
1314
1314
$exceptionHandlerProvider . mode ( 'log' ) ;
@@ -1319,7 +1319,6 @@ describe('resource', function() {
1319
1319
beforeEach ( inject ( function ( $injector ) {
1320
1320
$httpBackend = $injector . get ( '$httpBackend' ) ;
1321
1321
$resource = $injector . get ( '$resource' ) ;
1322
- $q = $injector . get ( '$q' ) ;
1323
1322
} ) ) ;
1324
1323
1325
1324
@@ -1357,34 +1356,5 @@ describe('resource', function() {
1357
1356
) ;
1358
1357
} ) ;
1359
1358
1360
- it ( 'should cancel the request if timeout promise is resolved' , function ( ) {
1361
- var canceler = $q . defer ( ) ;
1362
-
1363
- $httpBackend . when ( 'GET' , '/CreditCard' ) . respond ( { data : '123' } ) ;
1364
-
1365
- var CreditCard = $resource ( '/CreditCard' , { } , {
1366
- query : {
1367
- method : 'GET' ,
1368
- timeout : canceler . promise
1369
- }
1370
- } ) ;
1371
-
1372
- CreditCard . query ( ) ;
1373
-
1374
- canceler . resolve ( ) ;
1375
- expect ( $httpBackend . flush ) . toThrow ( new Error ( "No pending request to flush !" ) ) ;
1376
-
1377
- canceler = $q . defer ( ) ;
1378
- CreditCard = $resource ( '/CreditCard' , { } , {
1379
- query : {
1380
- method : 'GET' ,
1381
- timeout : canceler . promise
1382
- }
1383
- } ) ;
1384
-
1385
- CreditCard . query ( ) ;
1386
- expect ( $httpBackend . flush ) . not . toThrow ( ) ;
1387
- } ) ;
1388
-
1389
1359
1390
1360
} ) ;
0 commit comments