From 5857c44e0cc52309251c932f9c530958dfdb616c Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Tue, 15 Nov 2011 11:03:03 -0800 Subject: fix(radio): fix binding to value={{exp}} --- test/widget/inputSpec.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test') diff --git a/test/widget/inputSpec.js b/test/widget/inputSpec.js index 8a35407b..085cb2ea 100644 --- a/test/widget/inputSpec.js +++ b/test/widget/inputSpec.js @@ -423,6 +423,22 @@ describe('widget: input', function() { expect(inputs[0].checked).toBe(false); expect(inputs[1].checked).toBe(true); }); + + it('should data-bind the value attribute on initialization', inject( + function($rootScope, $compile){ + $rootScope.choice = 'b'; + $rootScope.items = ['a', 'b']; + var element = $compile( + '
  • '+ + ''+ + '
  • ')($rootScope); + + $rootScope.$digest(); + var inputs = element.find('input'); + expect(inputs[0].checked).toBe(false); + expect(inputs[1].checked).toBe(true); + })); }); -- cgit v1.2.3