Skip to content
This repository was archived by the owner on Feb 10, 2022. It is now read-only.

Commit d8f3b81

Browse files
author
vdemedes
committed
added test for Model.remove()
1 parent 0735a6d commit d8f3b81

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/mongorito.test.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,26 @@ describe ('Mongorito', function () {
142142
posts.length.should.equal(0);
143143
});
144144

145+
it ('should remove many documents', function *() {
146+
var n = 10;
147+
148+
while (n--) {
149+
var data = postFixture();
150+
var post = new Post(data);
151+
yield post.save();
152+
}
153+
154+
var posts;
155+
156+
posts = yield Post.all();
157+
posts.length.should.equal(10);
158+
159+
yield Post.remove();
160+
161+
posts = yield Post.all();
162+
posts.length.should.equal(0);
163+
});
164+
145165
describe ('Queries', function () {
146166
it ('should find all documents', function *() {
147167
var n = 10;

0 commit comments

Comments
 (0)