diff options
Diffstat (limited to 'test/widget/inputSpec.js')
| -rw-r--r-- | test/widget/inputSpec.js | 16 |
1 files changed, 16 insertions, 0 deletions
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( + '<li>'+ + '<input ng:repeat="item in items" ' + + ' type="radio" ng:model="choice" value="{{item}}" name="choice">'+ + '</li>')($rootScope); + + $rootScope.$digest(); + var inputs = element.find('input'); + expect(inputs[0].checked).toBe(false); + expect(inputs[1].checked).toBe(true); + })); }); |
