From 21116161f92eda06389daaef670aa593aa588bcd Mon Sep 17 00:00:00 2001 From: Morgan Chen Date: Thu, 21 Jun 2018 12:10:05 -0700 Subject: Fix bad parsing of JWT dates --- Example/Auth/Tests/FIRAuthTests.m | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'Example/Auth/Tests/FIRAuthTests.m') diff --git a/Example/Auth/Tests/FIRAuthTests.m b/Example/Auth/Tests/FIRAuthTests.m index 34c0499..8859cb3 100644 --- a/Example/Auth/Tests/FIRAuthTests.m +++ b/Example/Auth/Tests/FIRAuthTests.m @@ -1863,16 +1863,17 @@ static const NSTimeInterval kWaitInterval = .5; [self waitForSignInWithAccessToken:kTestAccessToken APIKey:kTestAPIKey completion:nil]; - NSString *kTestAPIKey2 = @"fakeAPIKey2"; - FIRUser *user2 = [FIRAuth auth].currentUser; - user2.requestConfiguration = [[FIRAuthRequestConfiguration alloc]initWithAPIKey:kTestAPIKey2]; - OCMExpect([_mockBackend getAccountInfo:[OCMArg any] callback:[OCMArg any]]) - .andDispatchError2([FIRAuthErrorUtils networkErrorWithUnderlyingError:[NSError new]]); - XCTestExpectation *expectation = [self expectationWithDescription:@"callback"]; - [[FIRAuth auth] updateCurrentUser:user2 completion:^(NSError *_Nullable error) { - XCTAssertEqual(error.code, FIRAuthErrorCodeNetworkError); - [expectation fulfill]; - }]; + NSString *kTestAPIKey2 = @"fakeAPIKey2"; + FIRUser *user2 = [FIRAuth auth].currentUser; + user2.requestConfiguration = [[FIRAuthRequestConfiguration alloc]initWithAPIKey:kTestAPIKey2]; + NSError *underlyingError = [NSError errorWithDomain:@"Test Error" code:1 userInfo:nil]; + OCMExpect([_mockBackend getAccountInfo:[OCMArg any] callback:[OCMArg any]]) + .andDispatchError2([FIRAuthErrorUtils networkErrorWithUnderlyingError:underlyingError]); + XCTestExpectation *expectation = [self expectationWithDescription:@"callback"]; + [[FIRAuth auth] updateCurrentUser:user2 completion:^(NSError *_Nullable error) { + XCTAssertEqual(error.code, FIRAuthErrorCodeNetworkError); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kExpectationTimeout handler:nil]; OCMVerifyAll(_mockBackend); } -- cgit v1.2.3