From 7726a69ae598301d9ea236ee65fbc1cdce1027ed Mon Sep 17 00:00:00 2001 From: Ivan Socolsky Date: Sun, 8 Feb 2015 11:20:22 -0300 Subject: [PATCH] fix txProposal#isPending --- lib/model/txproposal.js | 2 +- test/integration.js | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/model/txproposal.js b/lib/model/txproposal.js index 3a9d277..5ea96c0 100644 --- a/lib/model/txproposal.js +++ b/lib/model/txproposal.js @@ -147,7 +147,7 @@ TxProposal.prototype.reject = function(copayerId) { }; TxProposal.prototype.isPending = function() { - return this.status === 'pending'; + return !_.any(['boradcasted', 'rejected'], this.status); }; TxProposal.prototype.isAccepted = function() { diff --git a/test/integration.js b/test/integration.js index 479fa93..c8664b7 100644 --- a/test/integration.js +++ b/test/integration.js @@ -978,14 +978,11 @@ describe('Copay server', function() { server.getPendingTxs({}, function(err, txps) { should.not.exist(err); - txps.length.should.equal(0); - server.getTx({ - id: txpid - }, function(err, txp) { - txp.status.should.equal('accepted'); - should.not.exist(txp.txid); - done(); - }); + txps.length.should.equal(1); + var txp = txps[0]; + txp.status.should.equal('accepted'); + should.not.exist(txp.txid); + done(); }); }); });