add tests for WalletFactory

This commit is contained in:
Ryan X. Charles 2014-06-19 12:34:05 -07:00
parent 7ae6438478
commit 952b2a6d36
1 changed files with 17 additions and 0 deletions

View File

@ -169,4 +169,21 @@ describe('WalletFactory model', function() {
});
});
describe('#joinCreateSession', function() {
it('should call network.start', function() {
var wf = new WalletFactory(config, '0.0.1');
wf.network.cleanUp = sinon.spy();
wf.network.start = sinon.spy();
wf.joinCreateSession('8WtTuiFTkhP5ao7AF2QErSwV39Cbur6pdMebKzQXFqL59RscXM', 'test', null, undefined);
wf.network.start.calledOnce.should.equal(true);
});
it('should call network.start with private key', function() {
var wf = new WalletFactory(config, '0.0.1');
wf.network.cleanUp = sinon.spy();
wf.network.start = sinon.spy();
wf.joinCreateSession('8WtTuiFTkhP5ao7AF2QErSwV39Cbur6pdMebKzQXFqL59RscXM', 'test', null, undefined);
wf.network.start.getCall(0).args[0].privkey.length.should.equal(64); //privkey is hex of private key buffer
});
});
});