From 3edd7b8b01c9eca531190b28aed7c16f91760f8d Mon Sep 17 00:00:00 2001 From: Eneko Lakasta Date: Thu, 8 Feb 2018 14:50:17 +0100 Subject: [PATCH] add test should create a layergroup with default apikey token --- test/acceptance/auth/authorization.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/test/acceptance/auth/authorization.js b/test/acceptance/auth/authorization.js index c82b2a37..22df63e0 100644 --- a/test/acceptance/auth/authorization.js +++ b/test/acceptance/auth/authorization.js @@ -56,6 +56,31 @@ describe('authorization', function() { }); }); + it('should create a layergroup with default apikey token', function (done) { + const apikeyToken = 'default_public'; + const mapConfig = { + version: '1.7.0', + layers: [ + { + options: { + sql: 'select * FROM test_table', + cartocss: TestClient.CARTOCSS.POINTS, + cartocss_version: '2.3.0' + } + } + ] + }; + const testClient = new TestClient(mapConfig, apikeyToken); + + testClient.getLayergroup(function (err, layergroupResult) { + assert.ifError(err); + + assert.ok(layergroupResult.layergroupid); + + testClient.drain(done); + }); + }); + it('should fail if apikey does not grant access to table', function (done) { const mapConfig = { version: '1.7.0',