Skip to content

Commit

Permalink
Merge pull request #295 from ably/fix-rtl5b
Browse files Browse the repository at this point in the history
Fix RTL5b
  • Loading branch information
ricardopereira committed Mar 16, 2016
2 parents 3d7f9bc + 2adee49 commit 7e33512
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 28 deletions.
8 changes: 7 additions & 1 deletion Spec/RealtimeClientChannel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,13 @@ class RealtimeClientChannel: QuickSpec {
let channel = client.channels.get("test")
client.onError(AblyTests.newErrorProtocolMessage())
expect(client.connection.state).to(equal(ARTRealtimeConnectionState.Failed))
expect(channel.detach()).toNot(beNil())

waitUntil(timeout: testTimeout) { done in
channel.detach() { errorInfo in
expect(errorInfo!.code).to(equal(90000))
done()
}
}
}

// RTL5d
Expand Down
27 changes: 0 additions & 27 deletions Tests/ARTRealtimeChannelTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -320,33 +320,6 @@ - (void)testAttachFails {
[self waitForExpectationsWithTimeout:[ARTTestUtil timeout] handler:nil];
}

- (void)testDetachFails {
XCTestExpectation *exp = [self expectationWithDescription:@"testDetachFails"];
[ARTTestUtil testRealtime:^(ARTRealtime *realtime) {
_realtime = realtime;
ARTRealtimeChannel *channel = [realtime.channels get:@"attach"];
[realtime.connection on:^(ARTConnectionStateChange *stateChange) {
ARTRealtimeConnectionState state = stateChange.current;
if (state == ARTRealtimeConnected) {
[channel on:^(ARTErrorInfo *errorInfo) {
if (channel.state == ARTRealtimeChannelAttached) {
[realtime onError:[ARTTestUtil newErrorProtocolMessage]];
}
}];
[channel attach];
}
else if(state == ARTRealtimeFailed) {
[channel detach:^(ARTErrorInfo *errorInfo) {
XCTAssert(errorInfo);
XCTAssertEqual(errorInfo.code, 90000);
[exp fulfill];
}];
}
}];
}];
[self waitForExpectationsWithTimeout:[ARTTestUtil timeout] handler:nil];
}

- (void) testClientIdPreserved {
NSString *firstClientId = @"firstClientId";
NSString *channelName = @"channelName";
Expand Down

0 comments on commit 7e33512

Please sign in to comment.