Skip to content

Commit

Permalink
test: added room tracking test
Browse files Browse the repository at this point in the history
  • Loading branch information
rauchg committed Dec 24, 2012
1 parent 708af3f commit 46d069b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/socket.io.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.