diff options
| author | Vojta Jina | 2012-03-20 13:05:42 -0700 |
|---|---|---|
| committer | Vojta Jina | 2012-03-20 14:39:23 -0700 |
| commit | ade6c452753145c84884d17027a7865bf4b34b0c (patch) | |
| tree | b44cf36ce410187ab43bc2b236b91c1be0a26a4a /test/directive/inputSpec.js | |
| parent | 9eafd10fcdf8846194bbc325fe23fd3d6d9da155 (diff) | |
| download | angular.js-ade6c452753145c84884d17027a7865bf4b34b0c.tar.bz2 | |
feat(input.radio): Allow value attribute to be interpolated
Diffstat (limited to 'test/directive/inputSpec.js')
| -rw-r--r-- | test/directive/inputSpec.js | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/test/directive/inputSpec.js b/test/directive/inputSpec.js index 22c77f53..0b848df1 100644 --- a/test/directive/inputSpec.js +++ b/test/directive/inputSpec.js @@ -720,18 +720,30 @@ describe('input', function() { }); - // TODO(vojta): change interpolate ? - xit('should allow {{expr}} as value', function() { + it('should allow {{expr}} as value', function() { scope.some = 11; compileInput( '<input type="radio" ng-model="value" value="{{some}}" />' + '<input type="radio" ng-model="value" value="{{other}}" />'); - browserTrigger(inputElm[0]); - expect(scope.value).toBe(true); + scope.$apply(function() { + scope.value = 'blue'; + scope.some = 'blue'; + scope.other = 'red'; + }); + + expect(inputElm[0].checked).toBe(true); + expect(inputElm[1].checked).toBe(false); browserTrigger(inputElm[1]); - expect(scope.value).toBe(false); + expect(scope.value).toBe('red'); + + scope.$apply(function() { + scope.other = 'non-red'; + }); + + expect(inputElm[0].checked).toBe(false); + expect(inputElm[1].checked).toBe(false); }); }); |
