diff options
| author | Jeff Cross | 2013-12-04 14:33:58 -0800 |
|---|---|---|
| committer | Tobias Bosch | 2013-12-04 15:29:19 -0800 |
| commit | d802ed1b3680cfc1751777fac465b92ee29944dc (patch) | |
| tree | 923f6bb914c25c39ff5758a9dd83eb6bfa68d1e0 /test/ng | |
| parent | e8f4305e9d1587512dbef44733fd162caa1cef59 (diff) | |
| download | angular.js-d802ed1b3680cfc1751777fac465b92ee29944dc.tar.bz2 | |
fix($rootScope): broadcast $destroy event on $rootScope
Fixes #5169
Diffstat (limited to 'test/ng')
| -rw-r--r-- | test/ng/rootScopeSpec.js | 6 |
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); })); |
