use of org.mamute.model.User in project mamute by caelum.
the class SignupValidatorTest method should_verify_if_exists_user_with_same_name.
@Test
public void should_verify_if_exists_user_with_same_name() throws Exception {
String name = "existentName";
when(users.existsWithName(name)).thenReturn(true);
User user = user(name, VALID_EMAIL);
boolean valid = signupValidator.validate(user, VALID_PASSWORD, VALID_PASSWORD);
assertFalse(valid);
}
use of org.mamute.model.User in project mamute by caelum.
the class SignupValidatorTest method should_valid_user.
@Test
public void should_valid_user() throws Exception {
User user = user(VALID_USER_NAME, VALID_EMAIL);
boolean valid = signupValidator.validate(user, VALID_PASSWORD, VALID_PASSWORD);
assertTrue(valid);
}
use of org.mamute.model.User in project mamute by caelum.
the class SignupValidatorTest method should_verify_email.
@Test
public void should_verify_email() {
when(users.existsWithEmail("used@gmail.com")).thenReturn(true);
User user = user(VALID_USER_NAME, "used@gmail.com");
boolean valid = signupValidator.validate(user, VALID_PASSWORD, VALID_PASSWORD);
assertFalse(valid);
}
use of org.mamute.model.User in project mamute by caelum.
the class SignupValidatorTest method should_verify_tiny_password.
@Test
public void should_verify_tiny_password() throws Exception {
when(users.existsWithEmail(VALID_EMAIL)).thenReturn(false);
User user = user(VALID_USER_NAME, VALID_EMAIL);
boolean valid = signupValidator.validate(user, "12", "12");
assertFalse(valid);
}
use of org.mamute.model.User in project mamute by caelum.
the class UserPersonalInfoValidatorTest method should_not_validate_invalid_mail.
@Test
public void should_not_validate_invalid_mail() {
User artur = user("artur com seis caracteres", validEmail);
UserPersonalInfo info = new UserPersonalInfo(artur).withEmail("invalidEmail");
assertFalse(infoValidator.validate(info));
}
Aggregations