Skip to content

Commit

Permalink
Fix RTL7d: check log error message and data is intact
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardopereira committed Feb 17, 2016
1 parent d1d12b9 commit d709147
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion ablySpec/RealtimeClientChannel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,22 @@ class RealtimeClientChannel: QuickSpec {
}

waitUntil(timeout: testTimeout) { done in
let logTime = NSDate()

channel.on(.Failed) { errorInfo in
expect(errorInfo).toNot(beNil())
expect(errorInfo).to(equal(channel.errorReason))
}

channel.subscribe(testMessage.encoded.name) { message in
expect(message.data as? String).toNot(equal(testMessage.encoded.data))
expect(message.data as? String).to(equal(testMessage.encrypted.data))

let logs = querySyslog(forLogsAfter: logTime)
let line = logs.reduce("") { $0 + "; " + $1 } //Reduce in one line
expect(line).to(contain("ERROR: ARTDataDecoded failed to decode data as 'bad_encoding_type'"))

expect(channel.errorReason).toNot(beNil())

done()
}

Expand Down

0 comments on commit d709147

Please sign in to comment.