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

Commit 26e5fe41 by Jan Aagaard Meier

Fix tests to also work for PG

1 parent d3aebaa8
Showing with 6 additions and 10 deletions
......@@ -489,26 +489,22 @@ describe(Helpers.getTestDialectTeaser("DAOFactory"), function() {
it('always honors ZERO as primary key', function(_done) {
var permutations = [
{v: 0, k: 'intV'},
{v: '0', k: 'intV'},
{v: {where: {id: 0}}, k: 'intV'},
{v: {where: {id: '0'}}, k: 'strV'}
0,
'0',
{where: {id: 0}},
{where: {id: '0'}}
]
, SQLs = {
strV: "SELECT * FROM `Users` WHERE `Users`.`id`='0' LIMIT 1;",
intV: "SELECT * FROM `Users` WHERE `Users`.`id`=0 LIMIT 1;"
}
, done = _.after(2 * permutations.length, _done);
this.User.create({name: 'jack'}).success(function (jack) {
this.User.create({name: 'jill'}).success(function (jill) {
permutations.forEach(function(perm) {
this.User.find(perm.v).done(function(err, user) {
this.User.find(perm).done(function(err, user) {
expect(err).toBeNull();
expect(user).toBeNull();
done();
}).on('sql', function(s) {
expect(s).toEqual(SQLs[perm.k]);
expect(s.indexOf(0)).not.toEqual(-1);
done();
})
}.bind(this))
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!