From 94310549cf08c8b2458160ce8df852b3ad2eb447 Mon Sep 17 00:00:00 2001 From: Fabien Franzen Date: Fri, 15 Aug 2014 15:24:00 +0200 Subject: [PATCH] Implement embedded.destroy() integration --- test/relations.test.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/relations.test.js b/test/relations.test.js index 55a8e4cf..bc0a09d4 100644 --- a/test/relations.test.js +++ b/test/relations.test.js @@ -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 () {