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

Commit bef2f61c by Lemon

Added test for eager-loading many-many associations

1 parent bae25d42
Showing with 7 additions and 0 deletions
...@@ -381,6 +381,13 @@ describe(Support.getTestDialectTeaser("HasMany"), function() { ...@@ -381,6 +381,13 @@ describe(Support.getTestDialectTeaser("HasMany"), function() {
}) })
}) })
}) })
it("get associated objects with an eager load", function(done) {
this.User.find({where: {username: 'John'}, include: [ this.Task ]}).success(function (john) {
expect(john.tasks).to.have.length(2);
done();
})
})
}) })
it("removes the reference id, which was added in the first place", function(done) { it("removes the reference id, which was added in the first place", function(done) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!