Permalink
Browse files

(#683) - add unexistent attachment test

We have two types of errors here: first trying to get attachment
of unexistent document. Second: trying to get unexistent attachment
of existent document. This test covers second.
  • Loading branch information...
1 parent fbaf907 commit 2caa72ab5c890b48cd4b893a6b4d1fe32980a721 @neojski neojski committed with daleharvey Apr 17, 2013
Showing with 12 additions and 0 deletions.
  1. +12 −0 tests/test.attachments.js
@@ -349,6 +349,18 @@ adapters.map(function(adapter) {
});
});
});
+
+ asyncTest("Try to get unexistent attachment of some doc", function() {
+ initTestDB(this.name, function(err, db) {
+ db.put({_id: "foo"}, function(err, res) {
+ ok(!err, "doc inserted");
+ db.getAttachment("foo/unexistentAttachment", function(err, res) {
+ ok(err, "Correctly returned error");
+ start();
+ });
+ });
+ });
+ });
});

0 comments on commit 2caa72a

Please sign in to comment.