diff options
| author | Vojta Jina | 2011-10-31 12:03:09 -0700 |
|---|---|---|
| committer | Igor Minar | 2011-11-30 11:17:23 -0500 |
| commit | 7b705df2b77bbd5e112b976a7a9630327aa77aca (patch) | |
| tree | 55441469b87309ff324676ddc2426ed930e8f3a2 /test | |
| parent | a4c8ac7126aab33ac0d8296a7495475363a0ea9b (diff) | |
| download | angular.js-7b705df2b77bbd5e112b976a7a9630327aa77aca.tar.bz2 | |
feat($http): broadcast $http.request event
Diffstat (limited to 'test')
| -rw-r--r-- | test/service/httpSpec.js | 10 |
1 files changed, 10 insertions, 0 deletions
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() { |
