Upgrades windshaft to 0.37.3 and adds a test for named layers and interactivity

Closes #263
This commit is contained in:
Raul Ochoa 2015-02-17 19:28:05 +01:00
parent 2e577343d2
commit 7f20e296a3
4 changed files with 134 additions and 3 deletions

View File

@ -1,6 +1,9 @@
1.28.3 -- 2015-mm-dd
--------------------
Announcements:
- Upgrades windshaft to [0.37.3](https://github.com/CartoDB/Windshaft/releases/tag/0.37.3)
1.28.2 -- 2015-02-17
--------------------

4
npm-shrinkwrap.json generated
View File

@ -181,8 +181,8 @@
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz"
},
"windshaft": {
"version": "0.37.2",
"from": "windshaft@~0.37.2",
"version": "0.37.3",
"from": "windshaft@~0.37.3",
"dependencies": {
"chronograph": {
"version": "0.1.0",

View File

@ -25,7 +25,7 @@
"node-varnish": "https://github.com/Vizzuality/node-varnish/tarball/0.3.0",
"underscore" : "~1.6.0",
"dot": "~1.0.2",
"windshaft": "~0.37.2",
"windshaft": "~0.37.3",
"step": "~0.0.5",
"queue-async": "~1.0.7",
"request": "~2.9.203",

View File

@ -447,6 +447,134 @@ suite('named_layers', function() {
});
test('should return 200 and layergroup with private tables and interactivity', function(done) {
var privateTableTemplateNameInteractivity = 'private_table_template_interactivity';
var privateTableTemplate = {
"version": "0.0.1",
"auth": {
"method": "open"
},
"name": privateTableTemplateNameInteractivity,
"layergroup": {
"layers": [
{
"type": "cartodb",
"options": {
"attributes": {
"columns": [
"name"
],
"id": "cartodb_id"
},
"cartocss": "#layer { marker-fill: #cc3300; }",
"cartocss_version": "2.3.0",
"interactivity": "cartodb_id",
"sql": "select * from test_table_private_1"
}
}
]
}
};
var layergroup = {
version: '1.3.0',
layers: [
{
type: 'named',
options: {
name: privateTableTemplateNameInteractivity
}
}
]
};
Step(
function createTemplate() {
templateMaps.addTemplate(username, privateTableTemplate, this);
},
function createLayergroup(err) {
if (err) {
throw err;
}
var next = this;
assert.response(server,
{
url: '/tiles/layergroup',
method: 'POST',
headers: {
host: 'localhost',
'Content-Type': 'application/json'
},
data: JSON.stringify(layergroup)
},
{
status: 200
},
function(res, err) {
next(err, res);
}
);
},
function checkLayergroup(err, response) {
if (err) {
throw err;
}
var parsedBody = JSON.parse(response.body);
assert.ok(parsedBody.layergroupid);
assert.ok(parsedBody.last_updated);
return parsedBody.layergroupid;
},
function requestTile(err, layergroupId) {
if (err) {
throw err;
}
var next = this;
assert.response(server,
{
url: '/tiles/layergroup/' + layergroupId + '/0/0/0.png',
method: 'GET',
headers: {
host: 'localhost'
},
encoding: 'binary'
},
{
status: 200,
headers: {
'content-type': 'image/png'
}
},
function(res, err) {
next(err, res);
}
);
},
function handleTileResponse(err, res) {
if (err) {
throw err;
}
test_helper.checkCache(res);
return true;
},
function deleteTemplate(err) {
var next = this;
templateMaps.delTemplate(username, privateTableTemplate, function(/*delErr*/) {
// ignore deletion error
next(err);
});
},
function finish(err) {
done(err);
}
);
});
test('should return 403 when private table is accessed from non named layer', function(done) {
var layergroup = {