diff --git a/spec/realtime/channel.test.js b/spec/realtime/channel.test.js index 947cbe0fe9..0b4541cf3d 100644 --- a/spec/realtime/channel.test.js +++ b/spec/realtime/channel.test.js @@ -325,7 +325,7 @@ define(['ably', 'shared_helper', 'async'], function(Ably, helper, async) { channel.attach(); channel.whenState('attached', function() { firedImmediately = true; - test.ok(channel.state === 'attached', 'whenState fired when attached'); + test.equal(channel.state, 'attached', 'whenState fired when attached'); closeAndFinish(test, realtime); }); test.ok(!firedImmediately, 'whenState should not fire immediately as not attached'); diff --git a/spec/realtime/connection.test.js b/spec/realtime/connection.test.js index 3eaed5cc37..a1d6faadc4 100644 --- a/spec/realtime/connection.test.js +++ b/spec/realtime/connection.test.js @@ -136,7 +136,8 @@ define(['ably', 'shared_helper', 'async'], function(Ably, helper, async) { channel = realtime.channels.get('connectionQueuing'), connectionManager = realtime.connection.connectionManager; - connectionManager.once('transport.active', function(transport) { + realtime.connection.once('connected', function() { + var transport = connectionManager.activeProtocol.transport; channel.attach(function(err) { if(err) { test.ok(false, 'Attach failed with error: ' + helper.displayError(err)); @@ -160,7 +161,7 @@ define(['ably', 'shared_helper', 'async'], function(Ably, helper, async) { }, function(cb) { /* After the disconnect, on reconnect, spy on transport.send again */ - connectionManager.once('transport.active', function(transport) { + connectionManager.once('transport.pending', function(transport) { var oldSend = transport.send; transport.send = function(msg, msgCb) { @@ -169,7 +170,7 @@ define(['ably', 'shared_helper', 'async'], function(Ably, helper, async) { test.equal(msg.msgSerial, 0, 'Expect msgSerial of original message to still be 0'); test.equal(msg.messages.length, 1, 'Expect second message to not have been merged with the attempted message'); } else if(msg.messages[0].name === 'second') { - test.equal(msg.msgSerial, 1, 'Expect msgSerial of new message to be 0'); + test.equal(msg.msgSerial, 1, 'Expect msgSerial of new message to be 1'); cb(); } } diff --git a/spec/realtime/presence.test.js b/spec/realtime/presence.test.js index a14bcb1dd0..8c6190017d 100644 --- a/spec/realtime/presence.test.js +++ b/spec/realtime/presence.test.js @@ -1626,7 +1626,7 @@ define(['ably', 'shared_helper', 'async'], function(Ably, helper, async) { * set but missing from a sync */ exports.leave_published_for_member_missing_from_sync = function(test) { test.expect(6); - var realtime = helper.AblyRealtime(), + var realtime = helper.AblyRealtime({transports: helper.availableTransports}), continuousClientId = 'continuous', goneClientId = 'gone', continuousRealtime = helper.AblyRealtime({clientId: continuousClientId}), diff --git a/spec/realtime/upgrade.test.js b/spec/realtime/upgrade.test.js index f09e3f0891..ac713e56bc 100644 --- a/spec/realtime/upgrade.test.js +++ b/spec/realtime/upgrade.test.js @@ -540,9 +540,9 @@ define(['ably', 'shared_helper', 'async'], function(Ably, helper, async) { realtime.connection.once('connected', function() { channel.attach(function(err){ - test.ok(err.code, 90000, 'Check error code for channel attach timing out'); - test.ok(channel.state, 'suspended', 'Check channel goes into suspended state'); - test.ok(realtime.connection.state, 'connected', 'Check connection state is still connected'); + test.equal(err.code, 90007, 'Check error code for channel attach timing out'); + test.equal(channel.state, 'suspended', 'Check channel goes into suspended state'); + test.equal(realtime.connection.state, 'connected', 'Check connection state is still connected'); channel.attach(function(err){ test.ok(!err, 'Check a second attach works fine'); closeAndFinish(test, realtime)