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

Commit 84603352 by Daniel Durante

Forgot to explicitly expect MySQL and SQLite queries for testing .destroy().

1 parent 2c4c643c
Showing with 7 additions and 0 deletions
...@@ -1013,7 +1013,14 @@ describe(Support.getTestDialectTeaser("DAO"), function () { ...@@ -1013,7 +1013,14 @@ describe(Support.getTestDialectTeaser("DAO"), function () {
UserDestroy.create({newId: '123ABC', email: 'hello'}).success(function() { UserDestroy.create({newId: '123ABC', email: 'hello'}).success(function() {
UserDestroy.find({where: {email: 'hello'}}).success(function(user) { UserDestroy.find({where: {email: 'hello'}}).success(function(user) {
user.destroy().on('sql', function(sql) { user.destroy().on('sql', function(sql) {
if (dialect === "postgres" || dialect === "postgres-native") {
expect(sql).to.equal('DELETE FROM "UserDestroys" WHERE "newId" IN (SELECT "newId" FROM "UserDestroys" WHERE "newId"=\'123ABC\' LIMIT 1)') expect(sql).to.equal('DELETE FROM "UserDestroys" WHERE "newId" IN (SELECT "newId" FROM "UserDestroys" WHERE "newId"=\'123ABC\' LIMIT 1)')
}
else if (dialect === "mysql") {
expect(sql).to.equal("DELETE FROM `UserDestroys` WHERE `newId`='123ABC' LIMIT 1")
} else {
expect(sql).to.equal("DELETE FROM `UserDestroys` WHERE `newId`='123ABC'")
}
done() done()
}) })
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!