Skip to content

Commit 6ada162

Browse files
committed
A test to prove the patch works
1 parent 34df39d commit 6ada162

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

test/user_model.test.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,29 @@ describe("SQLite Model creation test", function(){
4747
expect(u.name).to.be.equal("John");
4848
else if(u.id == 2) {
4949
expect(u.name).to.be.equal("Doe");
50-
done();
50+
testArrayContents(done)
51+
// done();
5152
}
5253
});
5354
}
55+
56+
function testArrayContents(cb) {
57+
var namesSomething = [{name: 'John', some: 'object'}, {name: 'Doe', some: 'other object'}];
58+
var names = [];
59+
namesSomething.forEach(function(n) {
60+
names.push(n.name);
61+
});
62+
63+
User.find({
64+
where: {
65+
name: {inq: names}
66+
}
67+
}, function(err, foundUsers) {
68+
expect(names[0]).to.be.equal('John');
69+
expect(names[1]).to.be.equal('Doe');
70+
cb();
71+
});
72+
}
5473
});
5574

5675
it('should run auto-migration when model changes', function (done) {

0 commit comments

Comments
 (0)