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.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ng/rootScopeSpec.js b/test/ng/rootScopeSpec.js
index ee7fb796..55fc41b1 100644
--- a/test/ng/rootScopeSpec.js
+++ b/test/ng/rootScopeSpec.js
@@ -407,6 +407,22 @@ describe('Scope', function() {
first.$destroy();
expect(log).toEqual('first; first-child');
}));
+
+
+ it('should $destroy a scope only once and ignore any further destroy calls',
+ inject(function($rootScope) {
+ $rootScope.$digest();
+ expect(log).toBe('123');
+
+ first.$destroy();
+ first.$apply();
+ expect(log).toBe('12323');
+
+ first.$destroy();
+ first.$destroy();
+ first.$apply();
+ expect(log).toBe('1232323');
+ }));
});