aboutsummaryrefslogtreecommitdiffstats
path: root/test/widgetsSpec.js
diff options
context:
space:
mode:
authorMisko Hevery2010-04-12 19:05:39 -0700
committerMisko Hevery2010-04-12 19:05:39 -0700
commit7c49b255483c0381c23de41d108800f93ebc1979 (patch)
tree09c841a413070e3c1eb6d69661f4a344f4a9d556 /test/widgetsSpec.js
parent713307b6505a56ca7b5423b36e297070d756ff15 (diff)
downloadangular.js-7c49b255483c0381c23de41d108800f93ebc1979.tar.bz2
$invalid widget clear on switch change
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);
});
});