From 2c6e0d9b2a04fa7c11db1deab9757f538e988cfa Mon Sep 17 00:00:00 2001 From: Ricardo Pereira Date: Sun, 20 Mar 2016 08:47:51 +0000 Subject: [PATCH 1/2] RTP5b --- Spec/RealtimeClientPresence.swift | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Spec/RealtimeClientPresence.swift b/Spec/RealtimeClientPresence.swift index 86b01b117..88128900d 100644 --- a/Spec/RealtimeClientPresence.swift +++ b/Spec/RealtimeClientPresence.swift @@ -77,6 +77,33 @@ class RealtimeClientPresence: QuickSpec { } } + + // RTP5 + context("Channel state change side effects") { + + // RTP5b + it("all queued presence messages will be sent immediately and a presence SYNC will be initiated implicitly if a channel enters the ATTACHED state") { + let client = ARTRealtime(options: AblyTests.commonAppSetup()) + defer { client.close() } + let channel = client.channels.get("test") + channel.attach() + + waitUntil(timeout: testTimeout) { done in + channel.presence.enterClient("user", data: nil) { error in + expect(error).to(beNil()) + expect(channel.queuedMessages).to(haveCount(0)) + done() + } + expect(channel.queuedMessages).to(haveCount(1)) + } + + expect(channel.state).to(equal(ARTRealtimeChannelState.Attached)) + expect(channel.presence.syncComplete).toEventually(beTrue(), timeout: testTimeout) + expect(channel.presenceMap.members).to(haveCount(1)) + } + + } + // RTP15e let cases: [String:(ARTRealtimePresence, Optional<(ARTErrorInfo?)->Void>)->()] = [ "enterClient": { $0.enterClient("john", data: nil, callback: $1) }, From 428636a86cb4d97bb29a05d4e29170d3a9b8b017 Mon Sep 17 00:00:00 2001 From: Ricardo Pereira Date: Sun, 20 Mar 2016 08:48:01 +0000 Subject: [PATCH 2/2] RTP5b: pending --- Spec/RealtimeClientPresence.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spec/RealtimeClientPresence.swift b/Spec/RealtimeClientPresence.swift index 88128900d..f9f44e6b5 100644 --- a/Spec/RealtimeClientPresence.swift +++ b/Spec/RealtimeClientPresence.swift @@ -82,7 +82,7 @@ class RealtimeClientPresence: QuickSpec { context("Channel state change side effects") { // RTP5b - it("all queued presence messages will be sent immediately and a presence SYNC will be initiated implicitly if a channel enters the ATTACHED state") { + pending("all queued presence messages will be sent immediately and a presence SYNC will be initiated implicitly if a channel enters the ATTACHED state") { let client = ARTRealtime(options: AblyTests.commonAppSetup()) defer { client.close() } let channel = client.channels.get("test")