Require interactivity param in single-layer grid fetching request
Closes #69
This commit is contained in:
@@ -530,11 +530,24 @@ suite('server', function() {
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
test("get'ing a json with default style should return an grid", function(done){
|
||||
test("get'ing a grid with no interactivity should fail", function(done){
|
||||
assert.response(server, {
|
||||
headers: {host: 'localhost'},
|
||||
url: '/tiles/gadm4/6/31/24.grid.json',
|
||||
method: 'GET'
|
||||
},{}, function(res) {
|
||||
assert.equal(res.statusCode, 400, res.statusCode + ': ' + res.body);
|
||||
assert.deepEqual(JSON.parse(res.body), {"error":"Missing interactivity parameter"});
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
test("get'ing a json with default style should return an grid", function(done){
|
||||
assert.response(server, {
|
||||
headers: {host: 'localhost'},
|
||||
url: '/tiles/gadm4/6/31/24.grid.json?interactivity=cartodb_id',
|
||||
method: 'GET'
|
||||
},{
|
||||
status: 200,
|
||||
headers: { 'Content-Type': 'text/javascript; charset=utf-8; charset=utf-8',
|
||||
@@ -545,7 +558,7 @@ suite('server', function() {
|
||||
test("get'ing a json with default style should return an grid", function(done){
|
||||
assert.response(server, {
|
||||
headers: {host: 'localhost'},
|
||||
url: '/tiles/gadm4/6/31/24.grid.json',
|
||||
url: '/tiles/gadm4/6/31/24.grid.json?interactivity=cartodb_id',
|
||||
method: 'GET'
|
||||
},{
|
||||
status: 200,
|
||||
@@ -554,10 +567,13 @@ suite('server', function() {
|
||||
});
|
||||
|
||||
test("get'ing a json with default style and sql should return a constrained grid", function(done){
|
||||
var sql = querystring.stringify({sql: "SELECT * FROM gadm4 WHERE codineprov = '08'"})
|
||||
var q = querystring.stringify({
|
||||
interactivity: 'cartodb_id',
|
||||
sql: "SELECT * FROM gadm4 WHERE codineprov = '08'"
|
||||
})
|
||||
assert.response(server, {
|
||||
headers: {host: 'localhost'},
|
||||
url: '/tiles/gadm4/6/31/24.grid.json?' + sql,
|
||||
url: '/tiles/gadm4/6/31/24.grid.json?' + q,
|
||||
method: 'GET'
|
||||
},{
|
||||
status: 200,
|
||||
@@ -569,7 +585,7 @@ suite('server', function() {
|
||||
function(done) {
|
||||
assert.response(server, {
|
||||
headers: {host: 'localhost'},
|
||||
url: '/tiles/test_table_private_1/6/31/24.grid.json',
|
||||
url: '/tiles/test_table_private_1/6/31/24.grid.json?interactivity=cartodb_id',
|
||||
method: 'GET'
|
||||
},{}, function(res) {
|
||||
// 401 Unauthorized
|
||||
@@ -583,7 +599,7 @@ suite('server', function() {
|
||||
function(done) {
|
||||
assert.response(server, {
|
||||
headers: {host: 'unknown_user'},
|
||||
url: '/tiles/test_table_private_1/6/31/24.grid.json',
|
||||
url: '/tiles/test_table_private_1/6/31/24.grid.json?interactivity=cartodb_id',
|
||||
method: 'GET'
|
||||
},{
|
||||
}, function(res) {
|
||||
@@ -599,7 +615,7 @@ suite('server', function() {
|
||||
function(done) {
|
||||
assert.response(server, {
|
||||
headers: {host: 'localhost'},
|
||||
url: '/tiles/test_table_private_1/6/31/24.grid.json?map_key=1234',
|
||||
url: '/tiles/test_table_private_1/6/31/24.grid.json?map_key=1234&interactivity=cartodb_id',
|
||||
method: 'GET'
|
||||
},{}, function(res) {
|
||||
assert.equal(res.statusCode, 200, res.body);
|
||||
|
||||
Reference in New Issue
Block a user