From b4561ff951ff452e55e820f6f8344dc2668cfd90 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Mon, 22 Mar 2010 15:46:34 -0700 Subject: ng-repeat works --- test/directivesSpec.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'test/directivesSpec.js') diff --git a/test/directivesSpec.js b/test/directivesSpec.js index 176f9e70..2cee20d1 100644 --- a/test/directivesSpec.js +++ b/test/directivesSpec.js @@ -66,6 +66,20 @@ describe("directives", function(){ expect(element.text()).toEqual('brad;'); }); - it('should ng-repeat over object', function(){}); - it('should error on wrong parsing of ng-repeat', function(){}); + it('should ng-repeat over object', function(){ + var scope = compile(''); + scope.set('items', {misko:'swe', shyam:'set'}); + scope.updateView(); + expect(element.text()).toEqual('misko:swe;shyam:set;'); + }); + + it('should error on wrong parsing of ng-repeat', function(){ + var scope = compile(''); + var log = ""; + element.eachNode(function(li){ + log += li.attr('ng-error') + ';'; + log += li.hasClass('ng-exception') + ';'; + }); + expect(log).toEqual("\"Expected ng-repeat in form of 'item in collection' but got 'i dont parse'.\";true;"); + }); }); -- cgit v1.2.3