Skip to content

Commit

Permalink
Fix RSA8f4
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardopereira committed Apr 6, 2016
1 parent ade5c8a commit cb74c48
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions Spec/Auth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -845,29 +845,25 @@ class Auth : QuickSpec {
}

// RSA8f4
pending("ensure the message published with a wildcard '*' has the provided clientId") {
let token = getTestToken()
let options = ARTClientOptions(token: token)
options.environment = "sandbox"
options.clientId = "john"

it("ensure the message published with a wildcard '*' has the provided clientId") {
let options = AblyTests.commonAppSetup()
// Request a token with a wildcard '*' value clientId
options.token = getTestToken(clientId: "*")
let rest = ARTRest(options: options)
rest.httpExecutor = mockExecutor
let channel = rest.channels.get("test")

waitUntil(timeout: testTimeout) { done in
channel.publish([ARTMessage(name: nil, data: "no client", clientId: "john")]) { error in
let message = ARTMessage(name: nil, data: "message with an explicit clientId", clientId: "john")
channel.publish([message]) { error in
expect(error).to(beNil())
switch extractBodyAsJSON(mockExecutor.requests.first) {
case .Failure(let error):
fail(error)
case .Success(let httpBody):
expect(httpBody.unbox["clientId"] as? String).to(equal("john"))
channel.history { page, error in
expect(error).to(beNil())
expect(page!.items[0].clientId).to(equal("john"))
done()
}
done()
}
}
expect(rest.auth.clientId).to(equal("*"))
expect(rest.auth.clientId).to(beNil())
}

}
Expand Down

0 comments on commit cb74c48

Please sign in to comment.