diff --git a/test/ng/directive/ngModelSpec.js b/test/ng/directive/ngModelSpec.js index b21f21baeea1..9486b4d71f60 100644 --- a/test/ng/directive/ngModelSpec.js +++ b/test/ng/directive/ngModelSpec.js @@ -827,21 +827,15 @@ describe('ngModel', function() { it('should only validate to true if all validations are true', function() { - var curry = function(v) { - return function() { - return v; - }; - }; - ctrl.$modelValue = undefined; - ctrl.$validators.a = curry(true); - ctrl.$validators.b = curry(true); - ctrl.$validators.c = curry(false); + ctrl.$validators.a = valueFn(true); + ctrl.$validators.b = valueFn(true); + ctrl.$validators.c = valueFn(false); ctrl.$validate(); expect(ctrl.$valid).toBe(false); - ctrl.$validators.c = curry(true); + ctrl.$validators.c = valueFn(true); ctrl.$validate(); expect(ctrl.$valid).toBe(true); @@ -875,16 +869,10 @@ describe('ngModel', function() { it('should register invalid validations on the $error object', function() { - var curry = function(v) { - return function() { - return v; - }; - }; - ctrl.$modelValue = undefined; - ctrl.$validators.unique = curry(false); - ctrl.$validators.tooLong = curry(false); - ctrl.$validators.notNumeric = curry(true); + ctrl.$validators.unique = valueFn(false); + ctrl.$validators.tooLong = valueFn(false); + ctrl.$validators.notNumeric = valueFn(true); ctrl.$validate();