@@ -1052,8 +1052,7 @@ describe("basic usage", function() {
10521052 it ( 'should call the error callback if provided on non 2xx response' , function ( ) {
10531053 $httpBackend . expect ( 'GET' , '/CreditCard/123' ) . respond ( ERROR_CODE , ERROR_RESPONSE ) ;
10541054
1055- var ccs = CreditCard . get ( { id :123 } , callback , errorCB ) ;
1056- ccs . $promise . then ( noop , noop ) ;
1055+ CreditCard . get ( { id :123 } , callback , errorCB ) ;
10571056 $httpBackend . flush ( ) ;
10581057 expect ( errorCB ) . toHaveBeenCalledOnce ( ) ;
10591058 expect ( callback ) . not . toHaveBeenCalled ( ) ;
@@ -1063,8 +1062,7 @@ describe("basic usage", function() {
10631062 it ( 'should call the error callback if provided on non 2xx response (without data)' , function ( ) {
10641063 $httpBackend . expect ( 'GET' , '/CreditCard' ) . respond ( ERROR_CODE , ERROR_RESPONSE ) ;
10651064
1066- var ccs = CreditCard . get ( callback , errorCB ) ;
1067- ccs . $promise . then ( noop , noop ) ;
1065+ CreditCard . get ( callback , errorCB ) ;
10681066 $httpBackend . flush ( ) ;
10691067 expect ( errorCB ) . toHaveBeenCalledOnce ( ) ;
10701068 expect ( callback ) . not . toHaveBeenCalled ( ) ;
@@ -1564,7 +1562,6 @@ describe('cancelling requests', function() {
15641562 } ) ;
15651563
15661564 var ccs = CreditCard . get ( ) ;
1567- ccs . $promise . catch ( noop ) ;
15681565 ccs . $cancelRequest ( ) ;
15691566 expect ( $httpBackend . flush ) . toThrow ( new Error ( 'No pending request to flush !' ) ) ;
15701567
@@ -1584,7 +1581,6 @@ describe('cancelling requests', function() {
15841581 } ) ;
15851582
15861583 var ccs = CreditCard . get ( ) ;
1587- ccs . $promise . catch ( noop ) ;
15881584 ccs . $cancelRequest ( ) ;
15891585 expect ( $httpBackend . flush ) . toThrow ( new Error ( 'No pending request to flush !' ) ) ;
15901586
0 commit comments