use of org.mamute.model.Flag in project mamute by caelum.
the class FlagTest method should_throw_exception_when_setting_reason_in_not_other_type.
@Test(expected = IllegalStateException.class)
public void should_throw_exception_when_setting_reason_in_not_other_type() {
Flag flag = flag(FlagType.OBSOLETE, user("author", "author@brutal.com"));
flag.setReason("blabla");
}
use of org.mamute.model.Flag in project mamute by caelum.
the class QuestionTest method should_verify_that_a_user_already_flagged_question.
@Test
public void should_verify_that_a_user_already_flagged_question() throws Exception {
Question q = question.build();
User author = user("author", "author@brutal.com", 1l);
User other = user("other", "other@brutal.com", 2l);
Flag flag = flag(FlagType.OTHER, author);
q.add(flag);
assertTrue(q.alreadyFlaggedBy(author));
assertFalse(q.alreadyFlaggedBy(other));
}
Aggregations