Skip to content

Commit

Permalink
RTL10a: check if the rest channel history method was called
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardopereira committed Feb 17, 2016
1 parent f5b4cb2 commit 471c5b4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ablySpec/RealtimeClientChannel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,11 @@ class RealtimeClientChannel: QuickSpec {
let realtime = ARTRealtime(options: options)
defer { realtime.close() }

var restChannelHistoryMethodWasCalled = false
ARTRestChannel.testSuite_injectIntoClassMethod("history:callback:error:") {
restChannelHistoryMethodWasCalled = true
}

let channelRest = rest.channels.get("test")
let channelRealtime = realtime.channels.get("test")

Expand All @@ -637,12 +642,15 @@ class RealtimeClientChannel: QuickSpec {
done()
}
}
expect(restChannelHistoryMethodWasCalled).to(beTrue())
restChannelHistoryMethodWasCalled = false

waitUntil(timeout: testTimeout) { done in
try! channelRealtime.history(queryRealtime) { _, _ in
done()
}
}
expect(restChannelHistoryMethodWasCalled).to(beTrue())
}

}
Expand Down

0 comments on commit 471c5b4

Please sign in to comment.