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

Commit a3ec0afb by Mark Wainwright

Failing test case for issue #2749

1 parent 7ccfd801
Showing with 11 additions and 27 deletions
......@@ -1955,16 +1955,17 @@ describe(Support.getTestDialectTeaser('Include'), function() {
});
});
it('should work with a main record where & order and an include where', function () {
it('should work with paranoid, a main record where, an include where, and a limit', function (done) {
var Post = this.sequelize.define('post', {
date: DataTypes.DATE,
"public": DataTypes.BOOLEAN
}, {
paranoid: true
});
var Category = this.sequelize.define('category', {
slug: DataTypes.STRING
});
Post.hasMany(Category);
Category.belongsTo(Post);
......@@ -1972,29 +1973,15 @@ describe(Support.getTestDialectTeaser('Include'), function() {
return Promise.join(
Post.create({"public": true}),
Post.create({"public": true}),
Post.create({"public": false}),
Post.create({"public": true}),
Post.create({"public": true}),
Post.create({"public": false}),
Post.create({"public": true}),
Post.create({"public": true}),
Post.create({"public": false}),
Post.create({"public": false})
Post.create({"public": true})
).then(function (posts) {
return Promise.join(
Promise.map(posts.slice(4), function (post) {
return post.createCategory({slug: 'food'});
}),
Promise.map(posts.slice(4, 4), function (post) {
return post.createCategory({slug: 'yolo'});
})
);
return Promise.map(posts.slice(1, 3), function (post) {
return post.createCategory({slug: 'food'});
});
}).then(function () {
return Post.findAll({
limit: 3,
order: [['date', 'DESC']],
limit: 2,
where: {
"public": true
},
......@@ -2006,16 +1993,13 @@ describe(Support.getTestDialectTeaser('Include'), function() {
}
}
]
}).on('sql', function (sql) {
console.log(sql);
}).then(function (posts) {
expect(posts.length).to.equal(3);
expect(posts.length).to.equal(2);
done();
});
});
}).catch(function (err) {
console.log(err.sql);
throw err;
});
});
});
});
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!