aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVojta Jina2011-10-31 12:03:09 -0700
committerIgor Minar2011-11-30 11:17:23 -0500
commit7b705df2b77bbd5e112b976a7a9630327aa77aca (patch)
tree55441469b87309ff324676ddc2426ed930e8f3a2 /test
parenta4c8ac7126aab33ac0d8296a7495475363a0ea9b (diff)
downloadangular.js-7b705df2b77bbd5e112b976a7a9630327aa77aca.tar.bz2
feat($http): broadcast $http.request event
Diffstat (limited to 'test')
-rw-r--r--test/service/httpSpec.js10
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() {