From 972c3e9be0a7dc90097a0bf55c2d11a4f65ae991 Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Wed, 26 Oct 2011 21:16:01 -0700 Subject: refactor($http): change callback matching mechanism --- test/service/httpSpec.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'test/service') diff --git a/test/service/httpSpec.js b/test/service/httpSpec.js index b39ac3d7..11165adc 100644 --- a/test/service/httpSpec.js +++ b/test/service/httpSpec.js @@ -486,7 +486,7 @@ describe('$http', function() { $httpBackend.flush(); if (match) expect(callback).toHaveBeenCalledOnce(); - else expect(callback).not.toHaveBeenCalledOnce(); + else expect(callback).not.toHaveBeenCalled(); } beforeEach(function() { @@ -620,11 +620,6 @@ describe('$http', function() { }); - it('should call "xxx" when 0 status code', function() { - expectToMatch(0, 'xxx'); - }); - - it('should not call "2xx" when 0 status code', function() { expectToNotMatch(0, '2xx'); }); @@ -634,9 +629,9 @@ describe('$http', function() { expect(status).toBe(0); }); - $http({method: 'GET', url: '/0'}).on('xxx', callback); - $http({method: 'GET', url: '/-1'}).on('xxx', callback); - $http({method: 'GET', url: '/-2'}).on('xxx', callback); + $http({method: 'GET', url: '/0'}).on('always', callback); + $http({method: 'GET', url: '/-1'}).on('always', callback); + $http({method: 'GET', url: '/-2'}).on('always', callback); $httpBackend.flush(); expect(callback).toHaveBeenCalled(); -- cgit v1.2.3