diff --git a/Spec/Auth.swift b/Spec/Auth.swift index 2da858331..ccd2addec 100644 --- a/Spec/Auth.swift +++ b/Spec/Auth.swift @@ -1718,72 +1718,6 @@ class Auth : QuickSpec { } } - // RSA10c - it("should create a new token when no token exists or current token has expired") { - let rest = ARTRest(options: AblyTests.commonAppSetup()) - - let tokenParams = ARTTokenParams() - tokenParams.ttl = 3.0 //Seconds - - // FIXME: buffer of 15s for token expiry - - // No token exists - expect(rest.auth.tokenDetails?.token).to(beNil()) - - waitUntil(timeout: testTimeout) { done in - // Create token - rest.auth.authorise(tokenParams, options: nil) { tokenDetails, error in - expect(error).to(beNil()) - expect(tokenDetails).toNot(beNil()) - expect(tokenDetails?.token).toNot(beEmpty()) - - let expiredToken = tokenDetails?.token - // New token - delay(tokenParams.ttl + 1.0) { - rest.auth.authorise(nil, options: nil) { tokenDetails, error in - expect(error).to(beNil()) - guard let tokenDetails = tokenDetails else { - XCTFail("TokenDetails is nil"); done(); return - } - expect(tokenDetails.token).toNot(equal(expiredToken)) - done() - } - } - } - } - } - - // RSA10d - it("should issue a new token even if an existing token exists when AuthOption.force is true") { - let options = AblyTests.commonAppSetup() - options.clientId = "defClientId" - let rest = ARTRest(options: options) - - let authOptions = ARTAuthOptions() - authOptions.key = options.key - authOptions.force = true - - // Current token - waitUntil(timeout: testTimeout) { done in - rest.auth.authorise(nil, options: nil) { tokenDetails, error in - expect(error).to(beNil()) - expect(tokenDetails?.token).toNot(beNil()) - - let currentToken = tokenDetails?.token - - rest.auth.authorise(nil, options: authOptions) { tokenDetails, error in - expect(error).to(beNil()) - guard let tokenDetails = tokenDetails else { - XCTFail("TokenDetails is nil"); done(); return - } - expect(tokenDetails.clientId).to(equal("defClientId")) - expect(tokenDetails.token).toNot(equal(currentToken)) - done() - } - } - } - } - // RSA10e it("should use the requestToken implementation") { let rest = ARTRest(options: AblyTests.commonAppSetup())