Skip to content

Commit 50a9caa

Browse files
committed
Verifying that only a single object is deleted.
1 parent a4b2ec3 commit 50a9caa

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

test/del_spec.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,30 @@ describe("jsonld.del", function() {
4444
});
4545
});
4646
});
47+
48+
it("should del an iri", function(done) {
49+
db.jsonld.put(manu, function() {
50+
db.jsonld.del(manu["@id"], function() {
51+
db.get({}, function(err, triples) {
52+
// getting the full db
53+
expect(triples).to.have.property("length", 0);
54+
done();
55+
});
56+
});
57+
});
58+
});
59+
60+
it("should del a single object", function(done) {
61+
db.jsonld.put(manu, function() {
62+
db.jsonld.put(tesla, function() {
63+
db.jsonld.del(tesla, function() {
64+
db.get({}, function(err, triples) {
65+
// getting the full db
66+
expect(triples).to.have.property("length", 2);
67+
done();
68+
});
69+
});
70+
});
71+
});
72+
});
4773
});

0 commit comments

Comments
 (0)