Skip to content

Commit

Permalink
RTL6g3
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardopereira authored and tcard committed Apr 27, 2016
1 parent 5cbd468 commit 4b028b3
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Spec/RealtimeClientChannel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1340,6 +1340,29 @@ class RealtimeClientChannel: QuickSpec {
expect(resultClientId).toEventually(equal(message.clientId), timeout: testTimeout)
}

// RTL6g3
it("when publishing a Message with a different clientId attribute value from the identified client’s clientId, it should reject that publish operation immediately") {
let options = AblyTests.commonAppSetup()
options.clientId = "john"
let client = ARTRealtime(options: options)
defer { client.close() }
let channel = client.channels.get("test")

waitUntil(timeout: testTimeout) { done in
channel.publish([ARTMessage(name: nil, data: "message", clientId: "tester")]) { error in
expect(error!.message).to(contain("mismatched clientId"))
done()
}
}

waitUntil(timeout: testTimeout) { done in
channel.publish([ARTMessage(name: nil, data: "message")]) { error in
expect(error).to(beNil())
done()
}
}
}

}

// RTL6h
Expand Down

0 comments on commit 4b028b3

Please sign in to comment.