aboutsummaryrefslogtreecommitdiffstats
path: root/test/widgetsSpec.js
diff options
context:
space:
mode:
authorMisko Hevery2010-09-14 23:42:43 +0200
committerMisko Hevery2010-09-14 23:42:43 +0200
commit2a3a449c6d55cf41a9ceb76608438c0488cbe3c0 (patch)
tree4080dbbaeadab70dee96f9daa1175148924eee2c /test/widgetsSpec.js
parent894ffadc8c35da6c7daf3e16a9f4931b24f3b231 (diff)
parentd8e86291c4a92395988f50d883200cdab12f726e (diff)
downloadangular.js-2a3a449c6d55cf41a9ceb76608438c0488cbe3c0.tar.bz2
merge
Diffstat (limited to 'test/widgetsSpec.js')
-rw-r--r--test/widgetsSpec.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js
index 9134500a..3861ef4f 100644
--- a/test/widgetsSpec.js
+++ b/test/widgetsSpec.js
@@ -454,6 +454,23 @@ 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();
+
+ expect(element.text()).toEqual('igor');
+
+ scope.url = undefined;
+ scope.$eval();
+
+ expect(element.text()).toEqual('');
+ });
});
});