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

RSA7b3 #356

Merged
merged 1 commit into from
Apr 1, 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
RSA7b3
  • Loading branch information
ricardopereira committed Mar 24, 2016
commit fc8d6ddb52fe28331e08383bbcace501bfe4fac0
22 changes: 21 additions & 1 deletion Spec/Auth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,27 @@ class Auth : QuickSpec {
}

// RSA7b3
// TODO: Realtime.connection
it("should CONNECTED ProtocolMessages contain a clientId") {
let options = AblyTests.commonAppSetup()
options.clientId = "john"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a great test because it appears the clientId is set to john before the ProcotolMessage is received. You should have a null clientId but use a token with an implicit clientId and then check that the client library later sets the clientId based solely on the connectionDetails.clientId

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done #403.

options.autoConnect = false
let realtime = AblyTests.newRealtime(options)
defer { realtime.close() }

waitUntil(timeout: testTimeout) { done in
realtime.connection.once(.Connected) { stateChange in
expect(stateChange!.reason).to(beNil())
expect(realtime.auth.clientId).to(equal("john"))

let transport = realtime.transport as! TestProxyTransport
let connectedProtocolMessage = transport.protocolMessagesReceived.filter{ $0.action == .Connected }[0]
expect(connectedProtocolMessage.connectionDetails!.clientId).to(equal("john"))
done()
}
realtime.connect()
}
}

}

// RSA7c
Expand Down