Add tests for block events at Socket service

This commit is contained in:
Yemel Jardi 2014-06-23 15:05:06 -03:00
parent e1dc275ddd
commit 970a6f3d37
1 changed files with 8 additions and 0 deletions

View File

@ -41,6 +41,14 @@ describe("Unit: Socket Service", function() {
expect(Object.keys(ret)).to.have.length(2);
}));
it('Socket should support block event', inject(function(Socket) {
expect(Socket.isListeningBlocks()).to.be.false;
Socket.on('block', function() {});
expect(Socket.isListeningBlocks()).to.be.true;
Socket.removeAllListeners();
expect(Socket.isListeningBlocks()).to.be.false;
}));
it('Socket should support #removeAllListeners', inject(function(Socket) {
Socket.on('a', function() {});
Socket.on('b', function() {});