aboutsummaryrefslogtreecommitdiffstats
path: root/test/widgetsSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/widgetsSpec.js')
-rw-r--r--test/widgetsSpec.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js
index c6158c37..c64f03ca 100644
--- a/test/widgetsSpec.js
+++ b/test/widgetsSpec.js
@@ -221,10 +221,15 @@ describe('ng:switch', function(){
it('should call init on switch', function(){
var scope = compile('<ng:switch on="url" change="name=\'works\'"><div ng-switch-when="a">{{name}}</div></ng:include>');
+ var cleared = false;
scope.url = 'a';
+ scope.$invalidWidgets = {clearOrphans: function(){
+ cleared = true;
+ }};
scope.$init();
expect(scope.name).toEqual(undefined);
expect(scope.$element.text()).toEqual('works');
+ expect(cleared).toEqual(true);
});
});