use of br.com.caelum.vraptor.test.VRaptorTestResult in project mamute by caelum.
the class ListTest method should_list_by_tag.
@Test
public void should_list_by_tag() {
String tag = "java";
UserFlow navigation = tagList(tag);
VRaptorTestResult tagList = navigation.execute();
tagList.wasStatus(200).isValid();
List<Question> questions = tagList.getObject("questions");
boolean onlyTag = true;
for (Question q : questions) {
if (!q.getTagsAsString(" ").contains(tag)) {
onlyTag = false;
break;
}
}
assertTrue(onlyTag);
}
use of br.com.caelum.vraptor.test.VRaptorTestResult in project mamute by caelum.
the class ListTest method should_not_show_questions_with_too_low_reputation.
@Test
public void should_not_show_questions_with_too_low_reputation() {
UserFlow navigation = home();
VRaptorTestResult home = navigation.execute();
home.wasStatus(200).isInvalid();
List<Question> questions = home.getObject("questions");
boolean showLowReputation = false;
for (Question q : questions) {
if (q.getVoteCount() <= QuestionDAO.SPAM_BOUNDARY) {
showLowReputation = true;
break;
}
}
assertFalse(showLowReputation);
}
use of br.com.caelum.vraptor.test.VRaptorTestResult in project mamute by caelum.
the class SignupTest method should_not_sign_up_with_a_short_password.
@Test
public void should_not_sign_up_with_a_short_password() {
UserFlow navigation = signUp(navigate(), "Marco", randomEmail(), "123", "123");
VRaptorTestResult notSignedUpUser = navigation.followRedirect().execute();
notSignedUpUser.wasStatus(200).isValid();
List<String> errorsList = errorsList(notSignedUpUser);
assertTrue(errorsList.contains(message("signup.errors.password.length")));
}
Aggregations