Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTN18a #168

Merged
merged 1 commit into from
Jan 28, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions ablySpec/RealtimeClient.connection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,36 @@ class RealtimeClientConnection: QuickSpec {
}
}

// RTN18
context("state change side effects") {

// RTN18a
it("when a connection enters the DISCONNECTED state, it will have no effect on the the channel states") {
let options = AblyTests.commonAppSetup()
let client = ARTRealtime(options: options)
defer { client.close() }

let channel = client.channel("test")
channel.attach()

expect(channel.state).toEventually(equal(ARTRealtimeChannelState.Attached), timeout: testTimeout)

client.onDisconnected()

expect(client.connection().state).to(equal(ARTRealtimeConnectionState.Disconnected))
expect(channel.state).to(equal(ARTRealtimeChannelState.Attached))

waitUntil(timeout: testTimeout + options.disconnectedRetryTimeout) { done in
channel.publish("queuedMessage", cb: { status in
expect(status.state).to(equal(ARTState.Ok))
done()
})
}
expect(client.connection().state).to(equal(ARTRealtimeConnectionState.Connected))
}

}

}
}
}