Created
May 8, 2014 08:42
-
-
Save johnathan-sewell/2cad50b335aa62ed4cbc to your computer and use it in GitHub Desktop.
Dry Jasmine "it" blocks in forEach
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
describe('validation', function() { | |
['startDate', 'endDate'].forEach(function(key) { | |
it('expects ' + key + ' to be in ISO format', function() { | |
model.set(key, '2014-04-29T15:04:53.078Z'); | |
expect(model.isValid()).toEqual(true); | |
model.set(key, '2014/04/29'); | |
expect(model.isValid()).toEqual(false); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment