use of org.mamute.auth.rules.AuthorRule in project mamute by caelum.
the class AuthorRuleTest method should_allow_moderatable_author.
@Test
public void should_allow_moderatable_author() {
AuthorRule<Moderatable> rule = new AuthorRule<>();
User author = user("author", "author@brutal.com", 1l);
User other = user("other", "other@brutal.com", 2l);
Question question = new QuestionBuilder().withAuthor(author).build();
assertFalse(rule.isAllowed(other, question));
assertTrue(rule.isAllowed(author, question));
}
Aggregations