From b7f4d8c3c3c537f895d3cd7369f5b23ec94820e0 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Thu, 12 Jan 2012 16:50:31 -0800 Subject: fix($http): anonnymous response interceptors should be treated as factories --- test/service/httpSpec.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/service/httpSpec.js b/test/service/httpSpec.js index d827e941..766238d8 100644 --- a/test/service/httpSpec.js +++ b/test/service/httpSpec.js @@ -51,11 +51,13 @@ describe('$http', function() { }; }); // just change the response data and pass the response object along - $httpProvider.responseInterceptors.push(function(httpPromise) { - return httpPromise.then(function(response) { - response.data += '!'; - return response; - }); + $httpProvider.responseInterceptors.push(function() { + return function(httpPromise) { + return httpPromise.then(function(response) { + response.data += '!'; + return response; + }); + } }); // return a new resolved promise representing modified response object -- cgit v1.2.3