diff options
Diffstat (limited to 'test/ng/httpBackendSpec.js')
| -rw-r--r-- | test/ng/httpBackendSpec.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/ng/httpBackendSpec.js b/test/ng/httpBackendSpec.js index 7302de00..1be31984 100644 --- a/test/ng/httpBackendSpec.js +++ b/test/ng/httpBackendSpec.js @@ -93,14 +93,16 @@ describe('$httpBackend', function() { // onreadystatechange might by called multiple times // with readyState === 4 on mobile webkit caused by // xhrs that are resolved while the app is in the background (see #5426). - it('should remove onreadystatechange when it is called with readyState=4 to ignore multiple calls', function() { + it('should not process onreadystatechange callback with readyState == 4 more than once', function() { $backend('GET', 'URL', null, callback); xhr = MockXhr.$$lastInstance; xhr.status = 200; xhr.readyState = 4; xhr.onreadystatechange(); - expect(xhr.onreadystatechange).toBeUndefined(); + xhr.onreadystatechange(); + + expect(callback).toHaveBeenCalledOnce(); }); it('should set only the requested headers', function() { |
