Add (pending) test for getting unrenderable stored styles (#94)

Required upgrading mocha tester to ~0.14.0
This commit is contained in:
Sandro Santilli 2013-11-27 09:47:33 +01:00
parent 73819579f3
commit 2fa288fc4d
3 changed files with 74 additions and 9 deletions

44
npm-shrinkwrap.json generated
View File

@ -1,6 +1,6 @@
{
"name": "windshaft-cartodb",
"version": "1.5.0",
"version": "1.5.1",
"dependencies": {
"node-varnish": {
"version": "0.1.1"
@ -286,37 +286,65 @@
"lzma": {
"version": "1.2.3"
},
"strftime": {
"version": "0.6.2"
},
"semver": {
"version": "1.1.4"
},
"strftime": {
"version": "0.6.2"
},
"redis": {
"version": "0.8.6"
},
"mocha": {
"version": "1.2.1",
"version": "1.14.0",
"dependencies": {
"commander": {
"version": "0.6.1"
"version": "2.0.0"
},
"growl": {
"version": "1.5.1"
"version": "1.7.0"
},
"jade": {
"version": "0.26.3",
"dependencies": {
"commander": {
"version": "0.6.1"
},
"mkdirp": {
"version": "0.3.0"
}
}
},
"diff": {
"version": "1.0.2"
"version": "1.0.7"
},
"debug": {
"version": "0.7.4"
},
"mkdirp": {
"version": "0.3.5"
},
"glob": {
"version": "3.2.3",
"dependencies": {
"minimatch": {
"version": "0.2.12",
"dependencies": {
"lru-cache": {
"version": "2.5.0"
},
"sigmund": {
"version": "1.0.0"
}
}
},
"graceful-fs": {
"version": "2.0.1"
},
"inherits": {
"version": "2.0.1"
}
}
}
}
}

View File

@ -29,7 +29,7 @@
"lzma": "~1.2.3"
},
"devDependencies": {
"mocha": "1.2.1",
"mocha": "1.14.0",
"redis": "~0.8.3",
"strftime": "~0.6.0",
"semver": "~1.1.0"

View File

@ -163,6 +163,43 @@ suite('server', function() {
});
});
// See https://github.com/CartoDB/Windshaft-cartodb/issues/94
test.skip("get'ing unrenderable style", function(done) {
var base_key = 'map_style|'+test_database+'|my_table';
var style = '#s{bogus}';
Step(
function checkRedis() {
redis_client.keys(base_key+'*', this);
},
function setupRedisBase(err, matches) {
if ( err ) throw err;
assert.equal(matches.length, 0);
redis_client.set(base_key,
JSON.stringify({ style: style }),
this);
},
function getStyle(err) {
if ( err ) throw err;
var next = this;
assert.response(server, {
headers: {host: 'localhost'},
url: '/tiles/my_table/style',
method: 'GET'
}, {}, function(res) { next(null, res); });
},
function checkStyle(err, res) {
if ( err ) throw err;
assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body);
var parsed = JSON.parse(res.body);
assert.equal(parsed.style, style);
return null
},
function finish(err) {
done(err);
}
);
});
/////////////////////////////////////////////////////////////////////////////////
//
// POST STYLE