Skip to content

Commit

Permalink
Merge pull request #235 from ably/RTL10c
Browse files Browse the repository at this point in the history
RTL10c
  • Loading branch information
tcard committed Feb 22, 2016
2 parents b642c20 + 48034c4 commit 134ad7a
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 @@ -1112,6 +1112,33 @@ class RealtimeClientChannel: QuickSpec {
expect(restChannelHistoryMethodWasCalled).to(beTrue())
}

// RTL10c
it("should return a PaginatedResult page") {
let realtime = ARTRealtime(options: AblyTests.commonAppSetup())
defer { realtime.close() }
let channel = realtime.channels.get("test")

waitUntil(timeout: testTimeout) { done in
channel.publish(nil, data: "message") { errorInfo in
expect(errorInfo).to(beNil())
done()
}
}

waitUntil(timeout: testTimeout) { done in
try! channel.history { result, _ in
expect(result).to(beAKindOf(ARTPaginatedResult))
expect(result!.items).to(haveCount(1))
expect(result!.hasNext).to(beFalse())
// Obj-C generics get lost in translation
//Something related: https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160111/006792.html
let messages = result!.items as! [ARTMessage]
expect(messages[0].data as? String).to(equal("message"))
done()
}
}
}

}

}
Expand Down

0 comments on commit 134ad7a

Please sign in to comment.