aboutsummaryrefslogtreecommitdiffstats
path: root/test/widgetsSpec.js
diff options
context:
space:
mode:
authorIgor Minar2010-08-16 16:47:39 -0700
committerIgor Minar2010-08-16 16:47:39 -0700
commit0df7329a6a15947503f891fdfa933770a70559df (patch)
treedbe6f3abd2d3dc054b4c225099208cd8d566fc6c /test/widgetsSpec.js
parent59401b80ee36d56f7ede551669633abbc6dd1e24 (diff)
downloadangular.js-0df7329a6a15947503f891fdfa933770a70559df.tar.bz2
fix for ng:include does not remove partial if src goes to undefined
Diffstat (limited to 'test/widgetsSpec.js')
-rw-r--r--test/widgetsSpec.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js
index ad98e482..bdc8e59d 100644
--- a/test/widgetsSpec.js
+++ b/test/widgetsSpec.js
@@ -436,6 +436,21 @@ describe("widget", function(){
scope.$init();
expect(element.text()).toEqual('misko');
});
+
+ it('should remove previously included text if a falsy value is bound to src', function() {
+ var element = jqLite('<ng:include src="url" scope="childScope"></ng:include>');
+ var scope = angular.compile(element);
+ scope.childScope = createScope();
+ scope.childScope.name = 'igor';
+ scope.url = 'myUrl';
+ scope.$xhr.cache.data.myUrl = {value:'{{name}}'};
+ scope.$init();
+
+ scope.url = undefined;
+ scope.$eval();
+
+ expect(element.text()).toEqual('');
+ });
});
});