From 0055b11dd25d0fd66ed05ecb2163682b0abdbe24 Mon Sep 17 00:00:00 2001 From: Matias Pando Date: Thu, 18 Dec 2014 14:44:32 -0300 Subject: [PATCH] Improving test on Wallet --- test/Wallet.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/test/Wallet.js b/test/Wallet.js index 4c296dde9..972b547ff 100644 --- a/test/Wallet.js +++ b/test/Wallet.js @@ -196,14 +196,11 @@ describe('Wallet model', function() { w.version.should.be.equal('0.123'); }); - it('should check pending proposals', function(done) { + it('should check pending proposals case 2', function(done) { var w = createW2(null, 1); var utxo = createUTXO(w); w.blockchain.fixUnspent(utxo); - sinon.spy(w, 'sendIndexes'); - sinon.spy(w, 'sendTxProposal'); - w.spend({ toAddress: toAddress, amountSat: amountSatStr, @@ -211,11 +208,12 @@ describe('Wallet model', function() { should.not.exist(err); should.exist(id); status.should.equal(Wallet.TX_PROPOSAL_SENT); - w.sendTxProposal.calledOnce.should.equal(true); - w.sendIndexes.calledOnce.should.equal(false); w.network.send.calledOnce.should.equal(true); - + console.log(w.network.send.getCall(0).args[1]); + w.network.send.getCall(0).args[1].type.should.equal("txProposal"); + should.exist(w.network.send.getCall(0).args[1].indexes); + should.exist(w.network.send.getCall(0).args[1].txProposal); var p = w.getPendingTxProposalsCount(); p.pending.should.be.equal(1);