From 13a3b0e1fda5295544630fc26ce3ee8a95938f0d Mon Sep 17 00:00:00 2001 From: Ricardo Pereira Date: Fri, 20 Nov 2020 10:52:09 +0000 Subject: [PATCH] Remove RTP12b (doesn't exist anymore in spec v1.2) --- Spec/RealtimeClientPresence.swift | 129 ------------------------------ 1 file changed, 129 deletions(-) diff --git a/Spec/RealtimeClientPresence.swift b/Spec/RealtimeClientPresence.swift index a100e8912..6efb96406 100644 --- a/Spec/RealtimeClientPresence.swift +++ b/Spec/RealtimeClientPresence.swift @@ -3763,135 +3763,6 @@ class RealtimeClientPresence: QuickSpec { } - // RTP12 - context("history") { - - // RTP12b - context("supports the param untilAttach") { - - it("should be false as default") { - let query = ARTRealtimeHistoryQuery() - expect(query.untilAttach).to(equal(false)) - } - - it("should invoke an error when the untilAttach is specified and the channel is not attached") { - let client = ARTRealtime(options: AblyTests.commonAppSetup()) - defer { client.dispose(); client.close() } - let channel = client.channels.get("test") - - let query = ARTRealtimeHistoryQuery() - query.untilAttach = true - - do { - try channel.presence.history(query, callback: { _, _ in }) - } - catch let error as NSError { - if error.code == ARTRealtimeHistoryError.notAttached.rawValue { - return - } - fail("Shouldn't raise a global error, got \(error)") - } - fail("Should raise an error") - } - - struct CaseTest { - let untilAttach: Bool - } - - let cases = [CaseTest(untilAttach: true), CaseTest(untilAttach: false)] - - for caseItem in cases { - it("where value is \(caseItem.untilAttach), should pass the querystring param fromSerial with the serial number assigned to the channel") { - let options = AblyTests.commonAppSetup() - let client = ARTRealtime(options: options) - defer { client.dispose(); client.close() } - let channel = client.channels.get("test") - - let testHTTPExecutor = TestProxyHTTPExecutor(options.logHandler) - client.internal.rest.httpExecutor = testHTTPExecutor - - let query = ARTRealtimeHistoryQuery() - query.untilAttach = caseItem.untilAttach - - channel.attach() - expect(channel.state).toEventually(equal(ARTRealtimeChannelState.attached), timeout: testTimeout) - - waitUntil(timeout: testTimeout) { done in - expect { - try channel.presence.history(query) { _, errorInfo in - expect(errorInfo).to(beNil()) - done() - } - }.toNot(throwError() { err in fail("\(err)"); done() }) - } - - let queryString = testHTTPExecutor.requests.last!.url!.query - - if query.untilAttach { - expect(queryString).to(contain("fromSerial=\(channel.internal.attachSerial!)")) - } - else { - expect(queryString).toNot(contain("fromSerial")) - } - } - } - - it("should retrieve members prior to the moment that the channel was attached") { - let options = AblyTests.commonAppSetup() - - var disposable = [ARTRealtime]() - defer { - for clientItem in disposable { - clientItem.dispose() - clientItem.close() - } - } - - waitUntil(timeout: testTimeout) { done in - disposable += [AblyTests.addMembersSequentiallyToChannel("test", members: 25, options: options) { - done() - }] - } - - let client = ARTRealtime(options: options) - defer { client.dispose(); client.close() } - let channel = client.channels.get("test") - waitUntil(timeout: testTimeout) { done in - channel.attach() { _ in - done() - } - } - - waitUntil(timeout: testTimeout) { done in - disposable += [AblyTests.addMembersSequentiallyToChannel("test", members: 35, startFrom: 26, options: options) { - done() - }] - } - - let query = ARTRealtimeHistoryQuery() - query.untilAttach = true - - waitUntil(timeout: testTimeout) { done in - expect { - try channel.presence.history(query) { result, error in - expect(error).to(beNil()) - guard let result = result else { - fail("Result is empty"); done(); return - } - expect(result.items).to(haveCount(25)) - expect(result.hasNext).to(beFalse()) - expect((result.items.first)?.clientId).to(equal("user25")) - expect((result.items.last)?.clientId).to(equal("user1")) - done() - } - }.toNot(throwError() { err in fail("\(err)"); done() }) - } - } - - } - - } - // RTP13 it("Presence#syncComplete returns true if the initial SYNC operation has completed") { let options = AblyTests.commonAppSetup()