Permalink
Browse files

Merge branch 'namespace.auth' of github.com:3rd-Eden/Socket.IO into n…

…amespace.auth
  • Loading branch information...
2 parents e8e9226 + eecc0f1 commit 2342133e7e80bca7f67b4185ab4eb43ccb09d92a @3rd-Eden 3rd-Eden committed Jun 29, 2011
Showing with 25 additions and 0 deletions.
  1. +8 −0 support/test-runner/app.js
  2. +17 −0 test/socket.test.js
@@ -184,6 +184,14 @@ suite('socket.test.js', function () {
io.of('/b').on('connection', function (socket) {});
});
+ server('test authorizing for namespaces', function (io) {
+ io.of('/a')
+ .authorization(function (data, fn) {
+ fn(null, false);
+ })
+ .on('connection', function (socket) {});
+ });
+
server('test sending json from server', function (io) {
io.sockets.on('connection', function (socket) {
io.sockets.json.send(3141592);
View
@@ -172,6 +172,23 @@
});
},
+ 'test authorizing for namespaces': function (next) {
+ var socket = create().socket
+
+ function finish () {
+ socket.of('').disconnect();
+ next();
+ };
+
+ socket.of('/a')
+ .on('connect_failed', function (msg) {
+ console.log('winning');
+ next();
+ })
+ .on('error', function (msg) {
+ throw new Error(msg || 'Received an error');
+ });
+ },
'test sending json from server': function (next) {
var socket = create();

0 comments on commit 2342133

Please sign in to comment.