Search in sources :

Example 1 with RemoveAnythingFlaggedByModerator

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());
}
Also used : Comment(org.mamute.model.Comment) LoggedUser(org.mamute.model.LoggedUser) RemoveAnythingFlaggedByModerator(org.mamute.model.flag.RemoveAnythingFlaggedByModerator) Test(org.junit.Test)

Example 2 with RemoveAnythingFlaggedByModerator

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());
}
Also used : Comment(org.mamute.model.Comment) User(org.mamute.model.User) LoggedUser(org.mamute.model.LoggedUser) LoggedUser(org.mamute.model.LoggedUser) RemoveAnythingFlaggedByModerator(org.mamute.model.flag.RemoveAnythingFlaggedByModerator) Test(org.junit.Test)

Example 3 with RemoveAnythingFlaggedByModerator

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());
}
Also used : Comment(org.mamute.model.Comment) LoggedUser(org.mamute.model.LoggedUser) RemoveAnythingFlaggedByModerator(org.mamute.model.flag.RemoveAnythingFlaggedByModerator) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 Comment (org.mamute.model.Comment)3 LoggedUser (org.mamute.model.LoggedUser)3 RemoveAnythingFlaggedByModerator (org.mamute.model.flag.RemoveAnythingFlaggedByModerator)3 User (org.mamute.model.User)1