2018-10-24 00:39:02 +08:00
|
|
|
'use strict';
|
|
|
|
|
2018-08-16 19:55:39 +08:00
|
|
|
var assert = require('assert');
|
|
|
|
var dateWrapper = require('../../../../lib/cartodb/utils/date-wrapper');
|
|
|
|
|
|
|
|
describe('date-wrapper', function() {
|
|
|
|
|
|
|
|
it('should wrap property fields with spaces', function() {
|
|
|
|
const actual = dateWrapper.wrapDates(
|
|
|
|
'select * from table',
|
|
|
|
[{name: 'a'}, {name: 'b c'}]
|
|
|
|
);
|
|
|
|
const expected = `
|
|
|
|
SELECT
|
|
|
|
"a","b c"
|
|
|
|
FROM
|
|
|
|
(select * from table) _cdb_epoch_transformation `;
|
|
|
|
assert.equal(actual, expected);
|
|
|
|
});
|
|
|
|
});
|