@Test
  public void testGameOver() {
    actionCreator.gameOver();

    ArgumentCaptor<Action> actionCaptor = ArgumentCaptor.forClass(Action.class);
    verify(mockStore, times(1)).dispatch(actionCaptor.capture());

    List<Action> capturedActions = actionCaptor.getAllValues();

    Action.Navigate firstAction = (Action.Navigate) capturedActions.get(0);
    assertEquals(firstAction.getPage().getLayoutId(), R.layout.lose);
    assertEquals(firstAction.getAddToBackStack(), false);
  }
  @Test
  public void testInitiateGameError() {
    when(mockRepository.getRandomWord()).thenReturn(Observable.<Word>error(new Exception()));

    actionCreator.initiateGame();

    ArgumentCaptor<Action> actionCaptor = ArgumentCaptor.forClass(Action.class);
    verify(mockStore, times(3)).dispatch(actionCaptor.capture());

    List<Action> capturedActions = actionCaptor.getAllValues();

    Action.Navigate firstAction = (Action.Navigate) capturedActions.get(0);
    assertEquals(firstAction.getPage().getLayoutId(), R.layout.loading);
    assertEquals(firstAction.getAddToBackStack(), true);

    assertEquals(capturedActions.get(1), Action.Back.INSTANCE);
    assertEquals(capturedActions.get(2), Action.LoadWordError.INSTANCE);
  }
  @Test
  public void testInitiateGame() {
    actionCreator.initiateGame();

    ArgumentCaptor<Action> actionCaptor = ArgumentCaptor.forClass(Action.class);
    verify(mockStore, times(3)).dispatch(actionCaptor.capture());

    List<Action> capturedActions = actionCaptor.getAllValues();

    Action.Navigate firstAction = (Action.Navigate) capturedActions.get(0);
    assertEquals(firstAction.getPage().getLayoutId(), R.layout.loading);
    assertEquals(firstAction.getAddToBackStack(), true);

    Action.InitGame secondAction = (Action.InitGame) capturedActions.get(1);
    assertEquals(secondAction.getWord(), testWord);
    assertEquals(secondAction.getFinishTime(), ActionCreator.GAME_DURATION);

    Action.Navigate thirdAction = (Action.Navigate) capturedActions.get(2);
    assertEquals(thirdAction.getPage().getLayoutId(), R.layout.game);
    assertEquals(thirdAction.getAddToBackStack(), false);
  }