aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Minar2012-03-12 09:38:49 -0700
committerIgor Minar2012-03-12 23:04:11 -0700
commit4e6b065a2f24745ff9691914363ff49a94abb92f (patch)
tree59016ef76b479517da2881057f9d31d0df2de724
parent5e3db61b1de79aae9cdec41173d930eb93c410dd (diff)
downloadangular.js-4e6b065a2f24745ff9691914363ff49a94abb92f.tar.bz2
test(ng-include): add ng-include=src test
-rw-r--r--test/directive/ngIncludeSpec.js17
1 files changed, 15 insertions, 2 deletions
diff --git a/test/directive/ngIncludeSpec.js b/test/directive/ngIncludeSpec.js
index f4652a73..f5beebdc 100644
--- a/test/directive/ngIncludeSpec.js
+++ b/test/directive/ngIncludeSpec.js
@@ -30,10 +30,23 @@ describe('ng-include', function() {
}));
+ it('should support ng-include="src" syntax', inject(putIntoCache('myUrl', '{{name}}'),
+ function($rootScope, $compile) {
+ element = jqLite('<div ng-include="url"></div>');
+ jqLite(document.body).append(element);
+ element = $compile(element)($rootScope);
+ $rootScope.name = 'Alibaba';
+ $rootScope.url = 'myUrl';
+ $rootScope.$digest();
+ expect(element.text()).toEqual('Alibaba');
+ jqLite(document.body).html('');
+ }));
+
+
it('should remove previously included text if a falsy value is bound to src', inject(
putIntoCache('myUrl', '{{name}}'),
- function($rootScope, $compile, $browser) {
- element = jqLite('<div ng-include="url" scope="childScope"></div>');
+ function($rootScope, $compile) {
+ element = jqLite('<ng:include src="url" scope="childScope"></ng:include>');
element = $compile(element)($rootScope);
$rootScope.childScope = $rootScope.$new();
$rootScope.childScope.name = 'igor';