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

Commit 6ca09791 by Mick Hansen

[fix] use .escape() in test

1 parent 9197f74e
Showing with 3 additions and 3 deletions
...@@ -34,7 +34,7 @@ describe(Support.getTestDialectTeaser('Model'), function() { ...@@ -34,7 +34,7 @@ describe(Support.getTestDialectTeaser('Model'), function() {
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 = '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) {
...@@ -45,7 +45,7 @@ describe(Support.getTestDialectTeaser('Model'), function() { ...@@ -45,7 +45,7 @@ describe(Support.getTestDialectTeaser('Model'), function() {
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 = '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) {
...@@ -57,7 +57,7 @@ describe(Support.getTestDialectTeaser('Model'), function() { ...@@ -57,7 +57,7 @@ describe(Support.getTestDialectTeaser('Model'), function() {
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 = '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);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!