diff options
| author | Misko Hevery | 2011-10-20 11:06:06 -0700 |
|---|---|---|
| committer | Igor Minar | 2011-10-20 11:30:40 -0700 |
| commit | 7fc18b263dc74f52bb677e446f23e35d64948841 (patch) | |
| tree | 7e0bafb9966c17e5306387ca9fc1028cb7b1111b /test/widget | |
| parent | fabc9f77a3fae10c2b8d9a9ad1541e827cc0390d (diff) | |
| download | angular.js-7fc18b263dc74f52bb677e446f23e35d64948841.tar.bz2 | |
fix(radio): allows data-binding on value property. Closes#316
Diffstat (limited to 'test/widget')
| -rw-r--r-- | test/widget/inputSpec.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/widget/inputSpec.js b/test/widget/inputSpec.js index c73d5fdd..179f8156 100644 --- a/test/widget/inputSpec.js +++ b/test/widget/inputSpec.js @@ -402,6 +402,24 @@ describe('widget: input', function() { expect(inputs[0].checked).toBe(true); expect(inputs[1].checked).toBe(false); }); + + + it('it should work with value attribute that is data-bound', function(){ + compile( + '<li>'+ + '<input ng:repeat="item in [\'a\', \'b\']" ' + + ' type="radio" ng:model="choice" value="{{item}}" name="choice">'+ + '</li>'); + + var inputs = scope.$element.find('input'); + expect(inputs[0].checked).toBe(false); + expect(inputs[1].checked).toBe(false); + + scope.choice = 'b'; + scope.$digest(); + expect(inputs[0].checked).toBe(false); + expect(inputs[1].checked).toBe(true); + }); }); |
