use of org.mamute.model.flag.RemoveSolutionFlaggedByModerator in project mamute by caelum.
the class RemoveSolutionFlaggedByModeratorTest method should_handle_answer_flagged_by_moderator.
@Test
public void should_handle_answer_flagged_by_moderator() {
RemoveSolutionFlaggedByModerator action = new RemoveSolutionFlaggedByModerator(loggedModerator);
assertTrue(action.shouldHandle(new AnswerChild()));
assertTrue(action.shouldHandle(answer("blabla", question(null), null)));
}
use of org.mamute.model.flag.RemoveSolutionFlaggedByModerator in project mamute by caelum.
the class RemoveSolutionFlaggedByModeratorTest method should_not_handle_flag_of_normal_user.
@Test
public void should_not_handle_flag_of_normal_user() {
RemoveSolutionFlaggedByModerator action = new RemoveSolutionFlaggedByModerator(loggedUser);
Flaggable flaggable = new AnswerChild();
assertFalse(action.shouldHandle(flaggable));
}
use of org.mamute.model.flag.RemoveSolutionFlaggedByModerator in project mamute by caelum.
the class RemoveSolutionFlaggedByModeratorTest method should_remove_solution_from_question.
@Test
public void should_remove_solution_from_question() throws Exception {
RemoveSolutionFlaggedByModerator action = new RemoveSolutionFlaggedByModerator(loggedModerator);
Question question = question(user);
Answer answer = answer("blabla", question, user);
answer.markAsSolution();
action.fire(answer);
assertFalse(answer.isSolution());
assertFalse(question.isSolved());
}
Aggregations