sequelizer.distinct.test.js 589 B

12345678910111213141516171819
  1. var Sequelizer = require('../../../index')({ dialect: 'postgres' }).sequelizer;
  2. var analyze = require('../../support/analyze');
  3. var assert = require('assert');
  4. describe('Sequelizer ::', function() {
  5. describe('DISTINCT statements', function() {
  6. it('should generate a distinct query', function() {
  7. var tree = analyze({
  8. select: {
  9. distinct: ['firstName', 'lastName']
  10. },
  11. from: 'customers'
  12. });
  13. var result = Sequelizer(tree);
  14. assert.equal(result.sql, 'select distinct "firstName", "lastName" from "customers"');
  15. });
  16. });
  17. });