Skip to content

Commit

Permalink
RTL5j
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardopereira committed Nov 30, 2016
1 parent 5728e01 commit ad2f543
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Spec/RealtimeClientChannel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,32 @@ class RealtimeClientChannel: QuickSpec {
}
}

// RTL5j
it("if the channel state is SUSPENDED, the @detach@ request transitions the channel immediately to the DETACHED state") {
let client = ARTRealtime(options: AblyTests.commonAppSetup())
defer { client.dispose(); client.close() }
let channel = client.channels.get("foo")

waitUntil(timeout: testTimeout) { done in
channel.attach() { error in
expect(error).to(beNil())
done()
}
}

client.onSuspended()
expect(channel.state).to(equal(ARTRealtimeChannelState.Suspended))

waitUntil(timeout: testTimeout) { done in
channel.detach() { error in
expect(error).to(beNil())
done()
}
}

expect(channel.state).to(equal(ARTRealtimeChannelState.Detached))
}

}

// RTL6
Expand Down

0 comments on commit ad2f543

Please sign in to comment.