Refactor controllers

This commit is contained in:
Yemel Jardi 2014-08-28 15:18:05 -03:00
commit 16091bd330
9 changed files with 50 additions and 47 deletions

View file

@ -98,6 +98,14 @@ describe('Insight model', function() {
emitSpy.calledWith('subscribe', 'mg7UbtKgMvWAixTNMbC8soyUnwFk1qxEuM');
});
it('should subscribe to an address once', function() {
var blockchain = new Insight(FAKE_OPTS);
blockchain.subscribe('mg7UbtKgMvWAixTNMbC8soyUnwFk1qxEuM');
blockchain.subscribe('mg7UbtKgMvWAixTNMbC8soyUnwFk1qxEuM');
blockchain.subscribed.length.should.equal(1);
});
it('should subscribe to a list of addresses', function() {
var blockchain = new Insight(FAKE_OPTS);
var emitSpy = sinon.spy(blockchain.socket, 'emit');