aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng/httpSpec.js
diff options
context:
space:
mode:
authorVojta Jina2012-04-03 11:00:52 -0700
committerVojta Jina2012-04-04 16:13:02 -0700
commit86182a9415b9209662b16c25c180b958ba7e6cf9 (patch)
tree18661207396b5da54658676233ff0e15c6d975fc /test/ng/httpSpec.js
parent15ecc6f3668885ebc5c7130dd34e00059ddf79ae (diff)
downloadangular.js-86182a9415b9209662b16c25c180b958ba7e6cf9.tar.bz2
feat($http): add withCredentials config option
Diffstat (limited to 'test/ng/httpSpec.js')
-rw-r--r--test/ng/httpSpec.js25
1 files changed, 22 insertions, 3 deletions
diff --git a/test/ng/httpSpec.js b/test/ng/httpSpec.js
index ab50827c..24ff50b4 100644
--- a/test/ng/httpSpec.js
+++ b/test/ng/httpSpec.js
@@ -7,6 +7,7 @@ describe('$http', function() {
beforeEach(function() {
callback = jasmine.createSpy('done');
});
+
beforeEach(module(function($exceptionHandlerProvider) {
$exceptionHandlerProvider.mode('log');
}));
@@ -129,9 +130,6 @@ describe('$http', function() {
}));
- // TODO(vojta): test passing timeout
-
-
describe('params', function() {
it('should do basic request with params and encode', inject(function($httpBackend, $http) {
$httpBackend.expect('GET', '/url?a%3D=%3F%26&b=2').respond('');
@@ -943,4 +941,25 @@ describe('$http', function() {
});
});
});
+
+
+ it('should pass timeout and withCredentials', function() {
+ var $httpBackend = jasmine.createSpy('$httpBackend');
+
+ $httpBackend.andCallFake(function(m, u, d, c, h, timeout, withCredentials) {
+ expect(timeout).toBe(12345);
+ expect(withCredentials).toBe(true);
+ });
+
+ module(function($provide) {
+ $provide.value('$httpBackend', $httpBackend);
+ });
+
+ inject(function($http) {
+ $http({method: 'GET', url: 'some.html', timeout: 12345, withCredentials: true});
+ expect($httpBackend).toHaveBeenCalledOnce();
+ });
+
+ $httpBackend.verifyNoOutstandingExpectation = noop;
+ });
});