CartoDB-SQL-API/test/acceptance/query-multipart-test.js
Daniel García Aubert cc535b13d2 Use asert.strict mode
2019-12-26 14:23:21 +01:00

27 lines
819 B
JavaScript

'use strict';
require('../helper');
const server = require('../../lib/server')();
const assert = require('../support/assert');
describe('query-multipart', function () {
it('make query from a multipart form', function (done) {
assert.response(server, {
url: '/api/v1/sql',
formData: {
q: 'SELECT 2 as n'
},
headers: { host: 'vizzuality.cartodb.com' },
method: 'POST'
}, {}, function (err, res) {
assert.ifError(err);
const response = JSON.parse(res.body);
assert.strictEqual(typeof (response.time) !== 'undefined', true);
assert.strictEqual(response.total_rows, 1);
assert.deepStrictEqual(response.rows, [{ n: 2 }]);
done();
});
});
});