Add unit test to verify fix for #754
This commit is contained in:
parent
3bc2dacb1b
commit
2f71622e11
|
@ -428,6 +428,28 @@ describe('include', function () {
|
|||
});
|
||||
});
|
||||
|
||||
it('should save related items separately', function(done) {
|
||||
User.find({
|
||||
include: 'posts'
|
||||
})
|
||||
.then(function(users) {
|
||||
var posts = users[0].posts();
|
||||
posts.should.have.length(3);
|
||||
return users[0].save();
|
||||
})
|
||||
.then(function(updatedUser) {
|
||||
return User.findById(updatedUser.id, {
|
||||
include: 'posts'
|
||||
});
|
||||
})
|
||||
.then(function(user) {
|
||||
var posts = user.posts();
|
||||
posts.should.have.length(3);
|
||||
})
|
||||
.then(done)
|
||||
.catch(done);
|
||||
});
|
||||
|
||||
describe('performance', function () {
|
||||
var all;
|
||||
beforeEach(function() {
|
||||
|
|
Loading…
Reference in New Issue