From 3079a6f4e097a777414b8c3a8a87b8e1e20b55b5 Mon Sep 17 00:00:00 2001 From: Étienne Barrié Date: Wed, 31 Jul 2013 14:50:56 +0200 Subject: fix(ngMock): keep withCredentials on passThrough When using passThrough() and specifying withCredentials on the $http call, the option is now passed to the underlying $httpBackend. --- src/ngMock/angular-mocks.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ngMock/angular-mocks.js') diff --git a/src/ngMock/angular-mocks.js b/src/ngMock/angular-mocks.js index f7a9fec7..e016bc32 100644 --- a/src/ngMock/angular-mocks.js +++ b/src/ngMock/angular-mocks.js @@ -1045,7 +1045,7 @@ function createHttpBackendMock($rootScope, $delegate, $browser) { } // TODO(vojta): change params to: method, url, data, headers, callback - function $httpBackend(method, url, data, callback, headers, timeout) { + function $httpBackend(method, url, data, callback, headers, timeout, withCredentials) { var xhr = new MockXhr(), expectation = expectations[0], wasExpected = false; @@ -1103,7 +1103,7 @@ function createHttpBackendMock($rootScope, $delegate, $browser) { // if $browser specified, we do auto flush all requests ($browser ? $browser.defer : responsesPush)(wrapResponse(definition)); } else if (definition.passThrough) { - $delegate(method, url, data, callback, headers, timeout); + $delegate(method, url, data, callback, headers, timeout, withCredentials); } else throw Error('No response defined !'); return; } -- cgit v1.2.3