use of org.mamute.model.flag.RemoveAnythingFlaggedByModerator in project mamute by caelum.
the class RemoveAnythingFlaggedByModeratorTest method should_remove_comment_after_moderator_flag.
@Test
public void should_remove_comment_after_moderator_flag() {
RemoveAnythingFlaggedByModerator removeFlaggedByModerator = new RemoveAnythingFlaggedByModerator(new LoggedUser(user, null));
Comment comment = comment(author, "blablablablba");
removeFlaggedByModerator.fire(comment);
assertFalse(comment.isVisible());
}
use of org.mamute.model.flag.RemoveAnythingFlaggedByModerator in project mamute by caelum.
the class RemoveAnythingFlaggedByModeratorTest method should_not_handle_normal_user.
@Test
public void should_not_handle_normal_user() throws Exception {
User normal = user("normal", "normal@brutal.com");
RemoveAnythingFlaggedByModerator removeFlaggedByModerator = new RemoveAnythingFlaggedByModerator(new LoggedUser(normal, null));
Comment comment = comment(author, "blablablablba");
assertFalse(removeFlaggedByModerator.shouldHandle(comment));
assertTrue(comment.isVisible());
}
use of org.mamute.model.flag.RemoveAnythingFlaggedByModerator in project mamute by caelum.
the class RemoveAnythingFlaggedByModeratorTest method should_not_handle_not_logged_user.
@Test
public void should_not_handle_not_logged_user() throws Exception {
RemoveAnythingFlaggedByModerator removeFlaggedByModerator = new RemoveAnythingFlaggedByModerator(new LoggedUser(null, null));
Comment comment = comment(author, "blablablablba");
assertFalse(removeFlaggedByModerator.shouldHandle(comment));
assertTrue(comment.isVisible());
}
Aggregations