    @Test
    public void refresh() throws Exception {

        final Reddit reddit = new Reddit();
        PublishSubject<Reddit> subject = PublishSubject.create();
        Mockito.doReturn(subject.asObservable().toList())
                .when(mRepository)
                .getReddits(Mockito.anyString());
        mViewModel.refresh();
        Mockito.verify(mRepository).getReddits("test");
        Assert.assertThat(mViewModel.errorText.get(), IsNull.nullValue());
        Assert.assertThat(mViewModel.isLoading.get(), Is.is(true));
        subject.onNext(reddit);
        subject.onCompleted();
        Assert.assertThat(mViewModel.isLoading.get(), Is.is(false));
        Assert.assertThat(mViewModel.reddits, IsCollectionContaining.hasItems(reddit));
    }