Skip to content

Commit

Permalink
added event tests
Browse files Browse the repository at this point in the history
  • Loading branch information
abarnhard committed Oct 15, 2014
1 parent be063f8 commit 2b24ae2
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/acceptance/sockets.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,27 @@ describe('sockets', function(){
});
});

describe('event start-game', function(){
it('should alert all users that game has begun', function(done){
var client1 = io.connect(socketUrl, options),
json1 = '{"gameId":"200000000000000000000001", "player":"bob"}',
json2 = '{"gameId":"200000000000000000000001"}';

client1.on('connect', function(data){
client1.on('game-start', function(){
done();
});

client1.emit('join-game', json1, function(){
client1.emit('start-game', json2, function(){
// do nothing
});
});
});

});
});

});

/*
Expand Down

0 comments on commit 2b24ae2

Please sign in to comment.