From 24eafb00d11ed124453b8386f2d953fb726505b3 Mon Sep 17 00:00:00 2001 From: Ivan Socolsky Date: Thu, 20 Nov 2014 16:43:59 -0300 Subject: [PATCH] removed call to next(). fixed tests --- app/controllers/addresses.js | 1 - test/integration/txs.js | 21 +++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/controllers/addresses.js b/app/controllers/addresses.js index 28d66318..7a6ca75e 100644 --- a/app/controllers/addresses.js +++ b/app/controllers/addresses.js @@ -152,7 +152,6 @@ exports.multitxs = function(req, res, next) { processTxs(txs, from, to, function (err, transactions) { if (err) return common.handleErrors(err, res); res.jsonp(transactions); - return next(); }); }); } diff --git a/test/integration/txs.js b/test/integration/txs.js index 7e92ab74..0fc18f9c 100644 --- a/test/integration/txs.js +++ b/test/integration/txs.js @@ -34,21 +34,14 @@ describe('Transactions for multiple addresses', function() { beforeEach(function(c) { req = {}; res = {}; - res.jsonp = sinon.spy(); return c(); }); describe('Transactions from multiple addresses', function () { _.each(fixture, function (f) { it(f.test, function (done) { - req.param = sinon.stub(); - req.param.withArgs('addrs').returns(f.addrs.join(',')); - req.param.withArgs('from').returns(f.from); - req.param.withArgs('to').returns(f.to); - - var paginated = !_.isUndefined(f.from) || !_.isUndefined(f.to); - addresses.multitxs(req, res, function() { - var txs = res.jsonp.getCall(0).args[0]; + var checkResult = function(txs) { + var paginated = !_.isUndefined(f.from) || !_.isUndefined(f.to); txs.should.exist; if (paginated) { txs.totalItems.should.equal(f.totalTransactions); @@ -61,7 +54,15 @@ describe('Transactions for multiple addresses', function() { txs.length.should.equal(f.returnedTransactions); } done(); - }); + }; + + res.jsonp = checkResult; + req.param = sinon.stub(); + req.param.withArgs('addrs').returns(f.addrs.join(',')); + req.param.withArgs('from').returns(f.from); + req.param.withArgs('to').returns(f.to); + + addresses.multitxs(req, res); }); }); });