Skip to content

Commit 174f6b0

Browse files
tipycalFlowNarretz
authored andcommitted
Updating for xhrStatus changes
Closes angular#15626
1 parent ba7a1ea commit 174f6b0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/ng/httpBackendSpec.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ describe('$httpBackend', function() {
9090
});
9191

9292
it('should call completion function with xhr.statusText if present', function() {
93-
callback.and.callFake(function(status, response, headers, statusText) {
93+
callback.and.callFake(function(status, response, headers, statusText, xhrStatus) {
9494
expect(statusText).toBe('OK');
9595
});
9696

@@ -102,7 +102,7 @@ describe('$httpBackend', function() {
102102
});
103103

104104
it('should call completion function with empty string if not present', function() {
105-
callback.and.callFake(function(status, response, headers, statusText) {
105+
callback.and.callFake(function(status, response, headers, statusText, xhrStatus) {
106106
expect(statusText).toBe('');
107107
});
108108

@@ -155,11 +155,12 @@ describe('$httpBackend', function() {
155155
});
156156

157157
it('should not try to read response data when request is aborted', function() {
158-
callback.and.callFake(function(status, response, headers, statusText) {
158+
callback.and.callFake(function(status, response, headers, statusText, xhrStatus) {
159159
expect(status).toBe(-1);
160160
expect(response).toBe(null);
161161
expect(headers).toBe(null);
162162
expect(statusText).toBe('');
163+
expect(xhrStatus).toBe('Request Aborted');
163164
});
164165
$backend('GET', '/url', null, callback, {}, 2000);
165166
xhr = MockXhr.$$lastInstance;
@@ -174,11 +175,12 @@ describe('$httpBackend', function() {
174175
});
175176

176177
it('should complete the request on timeout', function() {
177-
callback.and.callFake(function(status, response, headers, statusText) {
178+
callback.and.callFake(function(status, response, headers, statusText, xhrStatus) {
178179
expect(status).toBe(-1);
179180
expect(response).toBe(null);
180181
expect(headers).toBe(null);
181182
expect(statusText).toBe('');
183+
expect(xhrStatus).toBe('Request Timed Out');
182184
});
183185
$backend('GET', '/url', null, callback, {});
184186
xhr = MockXhr.$$lastInstance;
@@ -511,4 +513,3 @@ describe('$httpBackend', function() {
511513
});
512514
});
513515
});
514-

0 commit comments

Comments
 (0)