Created
June 25, 2018 18:32
-
-
Save stalniy/d674863f9ad665a74c235760b385136d to your computer and use it in GitHub Desktop.
Lazy vars shared validators
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sharedExampleFor('Range validator', function(fieldName, min, max) { | |
it('rejects values greater than "max" value', function() { | |
$subject[fieldName] = max() + 1; | |
expect($subject.hasErrorOn(fieldName)).to.be.true; | |
}); | |
it('rejects values less than "min" value', function() { | |
$subject[fieldName] = min() - 1; | |
expect($subject.hasErrorOn(fieldName)).to.be.true; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment