aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng/rootScopeSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/ng/rootScopeSpec.js')
-rw-r--r--test/ng/rootScopeSpec.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/ng/rootScopeSpec.js b/test/ng/rootScopeSpec.js
index 69447a3c..287b5356 100644
--- a/test/ng/rootScopeSpec.js
+++ b/test/ng/rootScopeSpec.js
@@ -599,10 +599,14 @@ describe('Scope', function() {
}));
- it('should ignore remove on root', inject(function($rootScope) {
+ it('should broadcast $destroy on rootScope', inject(function($rootScope) {
+ var spy = spyOn(angular, 'noop');
+ $rootScope.$on('$destroy', angular.noop);
$rootScope.$destroy();
$rootScope.$digest();
expect(log).toEqual('123');
+ expect(spy).toHaveBeenCalled();
+ expect($rootScope.$$destroyed).toBe(true);
}));