Skip to content

Commit

Permalink
Added tests for instance removal
Browse files Browse the repository at this point in the history
  • Loading branch information
notheotherben committed Jan 15, 2014
1 parent 480b268 commit 27cc054
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/instance_db.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,27 @@ describe('orm', function () {
})
});
});

describe('remove', function() {
it('should remove instances from the database', function(done) {
model.get('billy', function(err, billy) {
if(err) return done(err);
should.exist(billy);

billy.remove(function(err) {
if(err) return done(err);
billy.__state.isNew.should.be.true;

model.get('billy', function(err, nothing) {
if(err) return done(err);
should.not.exist(nothing);

done();
});
});
});
});
});
});
});
});

0 comments on commit 27cc054

Please sign in to comment.