aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng/httpSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/ng/httpSpec.js')
-rw-r--r--test/ng/httpSpec.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/ng/httpSpec.js b/test/ng/httpSpec.js
index f7df3d4b..45d31eef 100644
--- a/test/ng/httpSpec.js
+++ b/test/ng/httpSpec.js
@@ -981,4 +981,27 @@ describe('$http', function() {
$httpBackend.verifyNoOutstandingExpectation = noop;
});
+
+
+ it('should use withCredentials from default', function() {
+ var $httpBackend = jasmine.createSpy('$httpBackend');
+
+ $httpBackend.andCallFake(function(m, u, d, c, h, timeout, withCredentials, responseType) {
+ expect(withCredentials).toBe(true);
+ });
+
+ module(function($provide) {
+ $provide.value('$httpBackend', $httpBackend);
+ });
+
+ inject(function($http) {
+ $http.defaults.withCredentials = true;
+ $http({
+ method: 'GET', url: 'some.html', timeout: 12345, responseType: 'json'
+ });
+ expect($httpBackend).toHaveBeenCalledOnce();
+ });
+
+ $httpBackend.verifyNoOutstandingExpectation = noop;
+ });
});