spec/javascript/server/handshake_spec.js in faye-0.7.2 vs spec/javascript/server/handshake_spec.js in faye-0.8.0
- old
+ new
@@ -1,10 +1,14 @@
JS.ENV.Server.HandshakeSpec = JS.Test.describe("Server handshake", function() { with(this) {
before(function() { with(this) {
this.engine = {}
stub(Faye.Engine, "get").returns(engine)
this.server = new Faye.Server()
+
+ this.connectionTypes = ["long-polling", "cross-origin-long-polling",
+ "callback-polling","websocket",
+ "eventsource","in-process"]
}})
describe("#handshake", function() { with(this) {
before(function() { with(this) {
this.message = {channel: "/meta/handshake",
@@ -23,11 +27,11 @@
server.handshake(message, false, function(response) {
assertEqual({
channel: "/meta/handshake",
successful: true,
version: "1.0",
- supportedConnectionTypes: ["long-polling", "cross-origin-long-polling", "callback-polling", "websocket","in-process"],
+ supportedConnectionTypes: connectionTypes,
clientId: "clientid"
}, response)
})
}})
@@ -39,11 +43,11 @@
server.handshake(message, false, function(response) {
assertEqual({
channel: "/meta/handshake",
successful: true,
version: "1.0",
- supportedConnectionTypes: ["long-polling", "cross-origin-long-polling", "callback-polling", "websocket","in-process"],
+ supportedConnectionTypes: connectionTypes,
clientId: "clientid",
id: "foo"
}, response)
})
}})
@@ -63,11 +67,11 @@
assertEqual({
channel: "/meta/handshake",
successful: false,
error: "402:version:Missing required parameter",
version: "1.0",
- supportedConnectionTypes: ["long-polling", "cross-origin-long-polling", "callback-polling", "websocket","in-process"]
+ supportedConnectionTypes: connectionTypes
}, response)
})
}})
}})
@@ -84,11 +88,11 @@
assertEqual({
channel: "/meta/handshake",
successful: false,
error: "402:supportedConnectionTypes:Missing required parameter",
version: "1.0",
- supportedConnectionTypes: ["long-polling", "cross-origin-long-polling", "callback-polling", "websocket","in-process"]
+ supportedConnectionTypes: connectionTypes
}, response)
})
}})
}})
@@ -107,11 +111,11 @@
assertEqual({
channel: "/meta/handshake",
successful: false,
error: "301:iframe,flash:Connection types not supported",
version: "1.0",
- supportedConnectionTypes: ["long-polling", "cross-origin-long-polling", "callback-polling", "websocket","in-process"]
+ supportedConnectionTypes: connectionTypes
}, response)
})
}})
}})
@@ -130,10 +134,10 @@
assertEqual({
channel: "/meta/handshake",
successful: false,
error: "invalid",
version: "1.0",
- supportedConnectionTypes: ["long-polling", "cross-origin-long-polling", "callback-polling", "websocket","in-process"]
+ supportedConnectionTypes: connectionTypes
}, response)
})
}})
}})
}})