use of org.survey.model.poll.QuestionType in project survey by markoniemi.
the class EditPollBeanTest method questionTypeChanged.
@Ignore("poll is attached and test does not represent the situation in runtime")
@Test
public void questionTypeChanged() {
// addQuestion calls addPoll
addQuestion();
editPollBean.getPoll().getQuestions().get(0).setType(QuestionType.BOOLEAN);
editPollBean.questionTypeChanged(0);
String result = editPollBean.savePoll();
Assert.assertEquals("editPollBean.savePoll returned an unexpected value", "pollSaved", result);
Poll pollFromDatabase = pollService.findOne("poll");
QuestionType type = pollFromDatabase.getQuestions().get(0).getType();
Assert.assertEquals(QuestionType.BOOLEAN, type);
}
Aggregations