From f71d08bdaf33a4ffff0e4f6f89297e824f30a983 Mon Sep 17 00:00:00 2001 From: Will Frew Date: Mon, 9 Mar 2015 18:32:29 +0000 Subject: [PATCH 1/2] Fix test to ensure multifetch doesn't call iteslf --- test/integration/multifetch.spec.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/integration/multifetch.spec.js b/test/integration/multifetch.spec.js index 61b4a12..239beff 100644 --- a/test/integration/multifetch.spec.js +++ b/test/integration/multifetch.spec.js @@ -311,10 +311,14 @@ describe('multifetch', function() { }); }); - it('should ignore multifetch resource', function() { + it('should be a successful response', function() { chai.expect(body).to.have.property('_error', false); }); + it('should ignore multifetch resource', function() { + chai.expect(body).not.to.have.property('multifetch'); + }); + it('should contain user album', function() { chai.expect(body) .to.have.property('album') @@ -348,7 +352,7 @@ describe('multifetch', function() { }); }); - it('should ignore multifetch resource', function() { + it('should be a successful response', function() { chai.expect(body).to.have.property('_error', false); }); From 6b586e767ec9922482e7b74c0e04f487a9bb9e58 Mon Sep 17 00:00:00 2001 From: Will Frew Date: Mon, 9 Mar 2015 18:33:16 +0000 Subject: [PATCH 2/2] Fixes multifetch calling itself bug --- source/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/index.js b/source/index.js index ccf8b5c..81af56b 100644 --- a/source/index.js +++ b/source/index.js @@ -31,7 +31,7 @@ var getResources = function(request, ignore) { var path = url.parse(request.url).pathname; return Object.keys(query).reduce(function(acc, key) { - if(key !== path && ignore.indexOf(key) === -1) { + if(query[key] !== path && ignore.indexOf(key) === -1) { acc[key] = query[key]; }