Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added another removal test

  • Loading branch information...
commit 1643f87df0154c7f2d688a42a8ca341a6b26c01f 1 parent fa4c8a4
@brenden brenden authored ryanfitz committed
Showing with 15 additions and 6 deletions.
  1. +14 −5 test/resourceful-mongo-test.js
  2. +1 −1  test/test-helper.js
View
19 test/resourceful-mongo-test.js
@@ -100,7 +100,6 @@ describe("Updating", function() {
});
});
});
-
});
describe("Finding", function(){
@@ -130,7 +129,6 @@ describe("Finding", function(){
done();
});
-
});
});
@@ -145,9 +143,7 @@ describe("Finding", function(){
done();
});
});
-
});
-
});
describe("Destroying", function() {
@@ -156,8 +152,21 @@ describe("Destroying", function() {
done();
});
});
-
+
it("by id", function(done) {
+
+ db.Person.create(db.people.bob, function(err, bob) {
+ db.Person.destroy(bob.id, function(err, result) {
+
+ if(err) done(err);
+
+ result.should.equal(1);
+ done();
+ });
+ });
+ });
+
+ it("by name", function(done) {
db.Person.destroy({name: "bob"}, function(err, result) {
if(err) done(err);
View
2  test/test-helper.js
@@ -37,7 +37,7 @@ DB.createPerson = function(person, callback) {
DB.drop = function(callback) {
- this.timeout(10000);
+ this.timeout(10000); //The tests are a bit slow because the database is dropped before each one.
if (!DB.Person.connection.connection) return callback();
Please sign in to comment.
Something went wrong with that request. Please try again.