Fix test for custom base_url

This commit is contained in:
Sandro Santilli 2013-05-24 13:51:39 +02:00
parent 7712d6f2a5
commit 985631092b

View File

@ -59,14 +59,12 @@ test('GET /api/v1/sql', function(done){
// Test base_url setting // Test base_url setting
test('GET /api/whatever/sql', function(done){ test('GET /api/whatever/sql', function(done){
assert.response(app, { assert.response(app, {
url: '/api/whatever/sql', url: '/api/whatever/sql?q=SELECT%201',
headers: {host: 'vizzuality.cartodb.com'},
method: 'GET' method: 'GET'
},{ },{
status: 400
}, function(res) { }, function(res) {
assert.deepEqual(res.headers['content-type'], 'application/json; charset=utf-8'); assert.equal(res.statusCode, 200, res.body);
assert.deepEqual(res.headers['content-disposition'], 'inline');
assert.deepEqual(JSON.parse(res.body), {"error":["You must indicate a sql query"]});
done(); done();
}); });
}); });