<commit_before>'use strict';

var chai = require('chai')
  , Sequelize = require('../../../index')
  , expect = chai.expect
  , Support = require(__dirname + '/../../support')
  , DataTypes = require(__dirname + '/../../../lib/data-types')
  , dialect = Support.getTestDialect()
  , config = require(__dirname + '/../../config/config')
  , datetime = require('chai-datetime')
  , _ = require('lodash')
  , moment = require('moment')
  , async = require('async')
  , current = Support.sequelize;

chai.use(datetime);
chai.config.includeStack = true;

describe(Support.getTestDialectTeaser('Model'), function() {
  describe('findAll', function () {
    describe('order', function () {
      describe('Sequelize.literal()', function () {
        beforeEach(function () {
          this.User = this.sequelize.define('User', {
            email: DataTypes.STRING
          });

          return this.User.sync({force: true}).bind(this).then(function () {
            return this.User.create({
              email: '<EMAIL>'
            });
          });
        });

        it('should work with order: literal()', function () {
          return this.User.findAll({
            order: this.sequelize.literal('email IS NOT NULL') 
          }).then(function (users) {
            expect(users.length).to.equal(1);
            users.forEach(function (user) {
              expect(user.get('email')).to.be.ok;
            });
          });
        });

        it('should work with order: [literal()]', function () {
          return this.User.findAll({
            order: [this.sequelize.literal('email IS NOT NULL')]
          }).then(function (users) {
            expect(users.length).to.equal(1);
            users.forEach(function (user) {
              expect(user.get('email')).to.be.ok;
            });
          });
        });

        it('should work with order: [[literal()]]', function () {
          return this.User.findAll({
            order: [
              [this.sequelize.literal('email IS NOT NULL')]
            ]
          }).then(function (users) {
            expect(users.length).to.equal(1);
            users.forEach(function (user) {
              expect(user.get('email')).to.be.ok;
            });
          });
        });
      });
    });
  });
});<commit_msg>[fix] change order literal test to equaliy rather than IS NULL to appease mssql<commit_after>'use strict';

var chai = require('chai')
  , Sequelize = require('../../../index')
  , expect = chai.expect
  , Support = require(__dirname + '/../../support')
  , DataTypes = require(__dirname + '/../../../lib/data-types')
  , dialect = Support.getTestDialect()
  , config = require(__dirname + '/../../config/config')
  , datetime = require('chai-datetime')
  , _ = require('lodash')
  , moment = require('moment')
  , async = require('async')
  , current = Support.sequelize;

chai.use(datetime);
chai.config.includeStack = true;

describe(Support.getTestDialectTeaser('Model'), function() {
  describe('findAll', function () {
    describe('order', function () {
      describe('Sequelize.literal()', function () {
        beforeEach(function () {
          this.User = this.sequelize.define('User', {
            email: DataTypes.STRING
          });

          return this.User.sync({force: true}).bind(this).then(function () {
            return this.User.create({
              email: '<EMAIL>'
            });
          });
        });

        it('should work with order: literal()', function () {
          return this.User.findAll({
            order: this.sequelize.literal("email = '<EMAIL>'") 
          }).then(function (users) {
            expect(users.length).to.equal(1);
            users.forEach(function (user) {
              expect(user.get('email')).to.be.ok;
            });
          });
        });

        it('should work with order: [literal()]', function () {
          return this.User.findAll({
            order: [this.sequelize.literal("email = '<EMAIL>'")]
          }).then(function (users) {
            expect(users.length).to.equal(1);
            users.forEach(function (user) {
              expect(user.get('email')).to.be.ok;
            });
          });
        });

        it('should work with order: [[literal()]]', function () {
          return this.User.findAll({
            order: [
              [this.sequelize.literal("email = '<EMAIL>'")]
            ]
          }).then(function (users) {
            expect(users.length).to.equal(1);
            users.forEach(function (user) {
              expect(user.get('email')).to.be.ok;
            });
          });
        });
      });
    });
  });
});
{'fraction_non_alphanumeric': 0.1808189655172414, 'fraction_numerical': 0.001293103448275862, 'mean_word_length': 1.9392020265991134, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1986656', 'n_tokens_mistral': 1321, 'n_tokens_neox': 1312, 'n_words': 225}