Skip to content

Commit

Permalink
(pouchdb#682) - test putting unencoded attachment
Browse files Browse the repository at this point in the history
  • Loading branch information
neojski authored and daleharvey committed Apr 15, 2013
1 parent 8b1bb55 commit b45f993
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/test.attachments.js
Expand Up @@ -303,6 +303,26 @@ adapters.map(function(adapter) {
});
});
});

asyncTest("Try to insert a doc with unencoded attachment", function() {
initTestDB(this.name, function(err, db) {
var doc = {
_id: "foo",
_attachments: {
"foo.txt": {
content_type: "text/plain",
data: "this should have been encoded!"
}
}
};
db.put(doc, function(err, res) {
ok(err, "error returned");
strictEqual(err.status, 500, "correct error");
strictEqual(err.error, "badarg", "correct error");
start();
});
});
});
});


Expand Down

0 comments on commit b45f993

Please sign in to comment.