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

Commit 34fe92c6 by Mick Hansen

Fix existing include tests

1 parent 1139fa0b
...@@ -502,7 +502,7 @@ module.exports = (function() { ...@@ -502,7 +502,7 @@ module.exports = (function() {
return attr return attr
}.bind(this)) }.bind(this))
mainAttributes = mainAttributes || (subQuery ? [options.table+'.*'] : ['*']) mainAttributes = mainAttributes || (options.include ? [options.table+'.*'] : ['*'])
if (subQuery) { if (subQuery) {
subQueryAttributes = mainAttributes subQueryAttributes = mainAttributes
......
...@@ -364,6 +364,7 @@ module.exports = (function() { ...@@ -364,6 +364,7 @@ module.exports = (function() {
}) })
delete result.__children delete result.__children
}) })
return results return results
} }
......
...@@ -391,11 +391,14 @@ describe(Support.getTestDialectTeaser("Include"), function () { ...@@ -391,11 +391,14 @@ describe(Support.getTestDialectTeaser("Include"), function () {
Price Price
]} ]}
], ],
order: 'id ASC' order: [
['Users.id', 'ASC']
]
}).done(function (err, users) { }).done(function (err, users) {
expect(err).not.to.be.ok expect(err).not.to.be.ok
users.forEach(function (user, i) { users.forEach(function (user, i) {
user.memberships.sort(sortById) user.memberships.sort(sortById)
expect(user.memberships.length).to.equal(2) expect(user.memberships.length).to.equal(2)
expect(user.memberships[0].group.name).to.equal('Developers') expect(user.memberships[0].group.name).to.equal('Developers')
expect(user.memberships[0].rank.canRemove).to.equal(1) expect(user.memberships[0].rank.canRemove).to.equal(1)
...@@ -1138,8 +1141,6 @@ describe(Support.getTestDialectTeaser("Include"), function () { ...@@ -1138,8 +1141,6 @@ describe(Support.getTestDialectTeaser("Include"), function () {
expect(product.prices.length).to.be.ok expect(product.prices.length).to.be.ok
}) })
done() done()
}).on('sql', function (sql) {
console.log(sql)
}) })
}) })
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!