Skip to content

Commit

Permalink
Merge pull request #212 from ably/RTL7f
Browse files Browse the repository at this point in the history
RTL7f
  • Loading branch information
ricardopereira committed Feb 17, 2016
2 parents 66b38d8 + d12472a commit 8dcd278
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions ablySpec/RealtimeClientChannel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,33 @@ class RealtimeClientChannel: QuickSpec {
expect(Test.counter).toEventually(equal(2), timeout: testTimeout)
}

// RTL7f
it("should exist ensuring published messages are not echoed back to the subscriber when echoMessages is false") {
let options = AblyTests.commonAppSetup()
let client1 = ARTRealtime(options: options)
defer { client1.close() }

options.echoMessages = false
let client2 = ARTRealtime(options: options)
defer { client2.close() }

let channel1 = client1.channels.get("test")
let channel2 = client2.channels.get("test")

waitUntil(timeout: testTimeout) { done in
channel1.subscribe { message in
expect(message.data as? String).to(equal("message"))
delay(5.0) { done() }
}

channel2.subscribe { message in
fail("Shouldn't receive the message")
}

channel2.publish(nil, data: "message")
}
}

}

}
Expand Down

0 comments on commit 8dcd278

Please sign in to comment.