diff --git a/test/unit/cartodb/utils/date-wrapper.test.js b/test/unit/cartodb/utils/date-wrapper.test.js new file mode 100644 index 00000000..e4fab99a --- /dev/null +++ b/test/unit/cartodb/utils/date-wrapper.test.js @@ -0,0 +1,18 @@ +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); + }); +});