From 95c5df5958f6d42d08846fa40c10cb279ce76ee9 Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Thu, 29 Mar 2012 13:50:27 -0700 Subject: fix(ngValue): bind properly inside ng-repeat --- test/ng/directive/inputSpec.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/ng/directive/inputSpec.js') diff --git a/test/ng/directive/inputSpec.js b/test/ng/directive/inputSpec.js index e5f083b3..734cb34d 100644 --- a/test/ng/directive/inputSpec.js +++ b/test/ng/directive/inputSpec.js @@ -1115,5 +1115,23 @@ describe('input', function() { browserTrigger(inputElm, 'click'); expect(scope.selected).toBe(scope.value); }); + + + it('should work inside ng-repeat', function() { + compileInput( + ''); + + scope.$apply(function() { + scope.items = [{id: 1}, {id: 2}]; + scope.selected = 1; + }); + + inputElm = formElm.find('input'); + expect(inputElm[0].checked).toBe(true); + expect(inputElm[1].checked).toBe(false); + + browserTrigger(inputElm.eq(1), 'click'); + expect(scope.selected).toBe(2); + }); }); }); -- cgit v1.2.3