Skip to content

Instantly share code, notes, and snippets.

@FranckSilvestre
Last active December 15, 2015 12:49
Show Gist options
  • Save FranckSilvestre/5262957 to your computer and use it in GitHub Desktop.
Save FranckSilvestre/5262957 to your computer and use it in GitHub Desktop.
Testing constraints in Grails version 2.1.1 vs version 2.1.2
void testConstraints() {
//...
Membre toto = new Membre()
// in version 2.1.2 or sup
assert !toto.validate()
assert "nullable" == toto.errors["prenom"].code
assert "nullable" == toto.errors["nom"].code
// in version 2.1.1
assert !toto.validate()
assert "nullable" == toto.errors["prenom"]
assert "nullable" == toto.errors["nom"]
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment