diff options
| author | Tom Hughes | 2012-07-29 17:52:19 -0700 | 
|---|---|---|
| committer | Misko Hevery | 2012-09-11 21:59:31 -0700 | 
| commit | 209b67df6a49fe1646ce63c5e7d11ed26e8abbc1 (patch) | |
| tree | cb02a4916b99150eef5758c845ce33074e9f2cdb /test/ng/httpSpec.js | |
| parent | 2e1539356a7ace9512110acea9808d497ed0789f (diff) | |
| download | angular.js-209b67df6a49fe1646ce63c5e7d11ed26e8abbc1.tar.bz2 | |
feat($http): Allow setting withCredentials on defaults
Closes #1095.
Diffstat (limited to 'test/ng/httpSpec.js')
| -rw-r--r-- | test/ng/httpSpec.js | 23 | 
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; +  });  });  | 
