We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UserTests testUniqueConstraint junit.framework.AssertionFailedError: null junit.framework.AssertionFailedError: junit.framework.AssertionFailedError: null at UserTests.testUniqueConstraint(UserTests.groovy:38)
Any ideas what causes this or how to fix it? I can't see anything wrong with the code.
The text was updated successfully, but these errors were encountered:
In the Second Ed of the pdf at:
110 | GETTING STARTED WITH GRAILS -SECOND EDITION
Add this test to UserTests:
void testUniqueConstraint(){ def jdoe = new User(login:"jdoe") def admin = new User(login:"admin") mockDomain(User, [jdoe, admin])
The instances of jdoe and admin require a password since the constraints on the domain class "User" dictated "password(blank:false,password:true)"
so just change the following lines: def jdoe = new User(login:"jdoe") def admin = new User(login:"admin")
to: def jdoe = new User(login:"jdoe", password:"1234") def admin = new User(login:"admin",password:"1234")
Sorry, something went wrong.
Also, sorry forgot to add this:
def badUser = new User(login:"jdoe",password:"1234")
Furthermore, I found that with grails 2.0.4 I need to add:
mockForConstraintsTests(User)
for the:
assertEquals 'unique', badUser.errors['login'] to return True
No branches or pull requests
UserTests
testUniqueConstraint
junit.framework.AssertionFailedError: null
junit.framework.AssertionFailedError: junit.framework.AssertionFailedError: null
at UserTests.testUniqueConstraint(UserTests.groovy:38)
Any ideas what causes this or how to fix it? I can't see anything wrong with the code.
The text was updated successfully, but these errors were encountered: