From 3f44ce19aa6d3b80cc0f7f48ca62430430705c3c Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Thu, 22 Dec 2016 16:38:38 +0700 Subject: [PATCH] Test ":" char isn't url encoded so filters work --- test/queries.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/queries.js b/test/queries.js index 097131f..1d3bb9d 100644 --- a/test/queries.js +++ b/test/queries.js @@ -16,3 +16,17 @@ test('Query string is built correctly', async t => { t.deepEqual(response.body, data.dummyResponse) t.truthy(scope.isDone()) }) + +test('":" char isn\'t url encoded so filters work', async t => { + const onionoo = new Onionoo() + + const defaultEndpoint = data.defaultEndpoints[0] + const scope = nock(data.defaultBaseUrl) + .get(`/${defaultEndpoint}?foo=key:value`) + .reply(200, data.dummyResponse) + + const response = await onionoo[defaultEndpoint]({ foo: 'key:value' }) + + t.deepEqual(response.body, data.dummyResponse) + t.truthy(scope.isDone()) +})