Skip to content

Commit

Permalink
Fix #117 test: add delay
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardopereira committed Sep 26, 2016
1 parent ad56876 commit afc03d9
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Spec/RestClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -991,14 +991,16 @@ class RestClient: QuickSpec {
options.token = getTestToken(ttl: 0.1)
let client = ARTRest(options: options)
waitUntil(timeout: testTimeout) { done in
client.channels.get("test").publish(nil, data: "message") { error in
guard let error = error else {
fail("Error is empty"); done()
return
delay(0.1) {
client.channels.get("test").publish(nil, data: "message") { error in
guard let error = error else {
fail("Error is empty"); done()
return
}
expect(error.code).to(equal(Int(ARTState.RequestTokenFailed.rawValue)))
expect(error.message).to(contain("no means to renew the token is provided"))
done()
}
expect(error.code).to(equal(Int(ARTState.RequestTokenFailed.rawValue)))
expect(error.message).to(contain("no means to renew the token is provided"))
done()
}
}
}
Expand Down

0 comments on commit afc03d9

Please sign in to comment.