Permalink
Browse files

test: added room tracking test

  • Loading branch information...
1 parent 708af3f commit 46d069b3ccf3060c6d4921131fc26f7f482c56b9 @rauchg rauchg committed Dec 24, 2012
Showing with 21 additions and 0 deletions.
  1. +21 −0 test/socket.io.js
View
@@ -515,5 +515,26 @@ describe('socket.io', function(){
});
});
});
+
+ it('keeps track of rooms', function(done){
+ var srv = http();
+ var sio = io(srv);
+
+ srv.listen(function(){
+ var socket = client(srv);
+ sio.on('connection', function(s){
+ s.join('a', function(){
+ expect(s.rooms).to.eql([s.id, 'a']);
+ s.join('b', function(){
+ expect(s.rooms).to.eql([s.id, 'a', 'b']);
+ s.leave('b', function(){
+ expect(s.rooms).to.eql([s.id, 'a']);
+ done();
+ });
+ });
+ });
+ });
+ });
+ });
});
});

0 comments on commit 46d069b

Please sign in to comment.