Skip to content

Commit

Permalink
unit test for notifyRoomChanges
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg committed Oct 29, 2013
1 parent e2e3e1b commit c961a9a
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,42 @@ module.exports = _.extend(suite, {
test.done();
}, pruneEmptyRooms + 100);

},

notifyRoomChanges: function(test) {

var server = this.server;
var client = suite.createClient();

test.expect(2);

var room;

server.configure({
port: this.port,
lobby: {
newMember: function(user) {
room = server.createRoom();
}
}
});

client.configure({
serverEvents: {
roomCreated: function() {
test.ok(true);
server.deleteRoom(room);
},
roomDeleted: function() {
test.ok(true);
test.done();
}
}
});

server.run();
client.run(this.host);

}

});

0 comments on commit c961a9a

Please sign in to comment.