test(ngOptions): ensure that one-time bindings works in ngOptions

Related #7700

Closes #8029
This commit is contained in:
rodyhaddad
2014-07-15 13:57:23 -07:00
parent 86d55c1ded
commit 7e6e0d6a39

View File

@@ -987,6 +987,20 @@ describe('select', function() {
expect(element.find('option').eq(0).prop('selected')).toBeTruthy();
expect(element.find('option').length).toEqual(2);
});
it('should use exact same values as values in scope with one-time bindings', function() {
scope.values = [{name: 'A'}, {name: 'B'}];
scope.selected = scope.values[0];
createSelect({
'ng-model': 'selected',
'ng-options': 'value.name for value in ::values'
});
browserTrigger(element.find('option').eq(1));
expect(scope.selected).toBe(scope.values[1]);
});
});