不要怂,就是干,撸起袖子干!

Commit 5eff94e1 by Mick Hansen

dont run orderBy literal tests for mssql, @mbroadst will have to fix later

1 parent 6ca09791
...@@ -39,5 +39,6 @@ MssqlDialect.prototype.supports = _.merge(_.cloneDeep(Abstract.prototype.support ...@@ -39,5 +39,6 @@ MssqlDialect.prototype.supports = _.merge(_.cloneDeep(Abstract.prototype.support
}); });
MssqlDialect.prototype.Query = Query; MssqlDialect.prototype.Query = Query;
MssqlDialect.prototype.name = 'mssql';
module.exports = MssqlDialect; module.exports = MssqlDialect;
...@@ -32,40 +32,42 @@ describe(Support.getTestDialectTeaser('Model'), function() { ...@@ -32,40 +32,42 @@ describe(Support.getTestDialectTeaser('Model'), function() {
}); });
}); });
it('should work with order: literal()', function () { if (current.dialect.name !== 'mssql') {
return this.User.findAll({ it('should work with order: literal()', function () {
order: this.sequelize.literal("email = "+this.sequelize.escape('test@sequelizejs.com')) return this.User.findAll({
}).then(function (users) { order: this.sequelize.literal("email = "+this.sequelize.escape('test@sequelizejs.com'))
expect(users.length).to.equal(1); }).then(function (users) {
users.forEach(function (user) { expect(users.length).to.equal(1);
expect(user.get('email')).to.be.ok; users.forEach(function (user) {
expect(user.get('email')).to.be.ok;
});
}); });
}); });
});
it('should work with order: [literal()]', function () { it('should work with order: [literal()]', function () {
return this.User.findAll({ return this.User.findAll({
order: [this.sequelize.literal("email = "+this.sequelize.escape('test@sequelizejs.com'))] order: [this.sequelize.literal("email = "+this.sequelize.escape('test@sequelizejs.com'))]
}).then(function (users) { }).then(function (users) {
expect(users.length).to.equal(1); expect(users.length).to.equal(1);
users.forEach(function (user) { users.forEach(function (user) {
expect(user.get('email')).to.be.ok; expect(user.get('email')).to.be.ok;
});
}); });
}); });
});
it('should work with order: [[literal()]]', function () { it('should work with order: [[literal()]]', function () {
return this.User.findAll({ return this.User.findAll({
order: [ order: [
[this.sequelize.literal("email = "+this.sequelize.escape('test@sequelizejs.com'))] [this.sequelize.literal("email = "+this.sequelize.escape('test@sequelizejs.com'))]
] ]
}).then(function (users) { }).then(function (users) {
expect(users.length).to.equal(1); expect(users.length).to.equal(1);
users.forEach(function (user) { users.forEach(function (user) {
expect(user.get('email')).to.be.ok; expect(user.get('email')).to.be.ok;
});
}); });
}); });
}); }
}); });
}); });
}); });
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!