diff options
| author | Vojta Jina | 2011-10-26 21:16:01 -0700 | 
|---|---|---|
| committer | Igor Minar | 2011-11-30 11:17:22 -0500 | 
| commit | 972c3e9be0a7dc90097a0bf55c2d11a4f65ae991 (patch) | |
| tree | f31e153e6b72490bf36b92e42a6996a542ef9e10 /test | |
| parent | feacf608eefa8cc64845a643f7270c9c3a16d1b8 (diff) | |
| download | angular.js-972c3e9be0a7dc90097a0bf55c2d11a4f65ae991.tar.bz2 | |
refactor($http): change callback matching mechanism
Diffstat (limited to 'test')
| -rw-r--r-- | test/service/httpSpec.js | 13 | 
1 files changed, 4 insertions, 9 deletions
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();  | 
