From 7b705df2b77bbd5e112b976a7a9630327aa77aca Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Mon, 31 Oct 2011 12:03:09 -0700 Subject: feat($http): broadcast $http.request event --- test/service/httpSpec.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') diff --git a/test/service/httpSpec.js b/test/service/httpSpec.js index 11165adc..12921992 100644 --- a/test/service/httpSpec.js +++ b/test/service/httpSpec.js @@ -686,6 +686,16 @@ describe('$http', function() { }); + it('should broadcast $http.request', function() { + $httpBackend.when('GET').then(200); + scope.$on('$http.request', callback); + var xhrFuture = $http({method: 'GET', url: '/whatever'}); + + expect(callback).toHaveBeenCalledOnce(); + expect(callback.mostRecentCall.args[1]).toBe(xhrFuture); + }); + + describe('transform', function() { describe('request', function() { -- cgit v1.2.3