use of com.kickstarter.libs.MockCurrentUser in project android-oss by kickstarter.
the class ActivityFeedViewModelTest method testErroredBackings_whenLoggedIn.
@Test
public void testErroredBackings_whenLoggedIn() {
final CurrentUserType currentUser = new MockCurrentUser();
final User initialUser = UserFactory.user();
currentUser.login(initialUser, "deadbeef");
final User updatedUser = UserFactory.user();
final Environment environment = this.environment().toBuilder().apiClient(new MockApiClient() {
@NonNull
@Override
public Observable<User> fetchCurrentUser() {
return Observable.just(updatedUser);
}
}).currentUser(currentUser).build();
setUpEnvironment(environment);
this.erroredBackings.assertValueCount(1);
this.vm.inputs.refresh();
this.erroredBackings.assertValueCount(2);
this.segmentTrack.assertValue(EventName.PAGE_VIEWED.getEventName());
}
Aggregations