@Test
public void itHidesProgressDialogOnDestroyToAvoidNotAttachedWindowManager() {

  when(progressDialogMock.isShowing()).thenReturn(true);
  createActivityWith(aFeed("Awesome Feed")).onDestroy();
  // first hide dialog after async task, then hides again on destroy
  verify(progressDialogMock, times(2)).dismiss();
}