@Test public void shouldForwardUserToEndOfQuizMenuIfInvalidInputIsPressed() { final String INVALID_INPUT = "invalid input"; when(messages.get(IVRMessage.INVALID_INPUT)).thenReturn(INVALID_INPUT); String nextAction = endOfQuizMenuAnswerAction.handle(new IVRRequest(null, null, null, "*"), request, response); verify(ivrResponseBuilder).addPlayText(INVALID_INPUT); assertThat(nextAction, is("forward:/endOfQuizMenu")); }
@Test public void shouldForwardUserToLastChapterIfOptionPressedIs3() { String nextAction = endOfQuizMenuAnswerAction.handle(new IVRRequest(null, null, null, "3"), request, response); assertThat(nextAction, is("forward:/repeatLastChapter")); }
@Test public void shouldForwardUserToQuizIfOptionPressedIs1() { String nextAction = endOfQuizMenuAnswerAction.handle(new IVRRequest(null, null, null, "1"), request, response); assertThat(nextAction, is("forward:/startQuiz")); }