Implement embedded.destroy() integration

This commit is contained in:
Fabien Franzen 2014-08-15 15:24:00 +02:00
parent 96a276a12b
commit 94310549cf
1 changed files with 17 additions and 0 deletions

View File

@ -1805,6 +1805,23 @@ describe('relations', function () {
});
});
it('should remove items from scope - and save parent', function(done) {
Category.findById(category.id, function(err, cat) {
cat.items.at(0).destroy(function(err, link) {
cat.links.should.eql([]);
done();
});
});
});
it('should find items on scope - verify destroy', function(done) {
Category.findById(category.id, function(err, cat) {
cat.name.should.equal('Category B');
cat.links.should.eql([]);
done();
});
});
});
describe('embedsMany - polymorphic relations', function () {