summaryrefslogtreecommitdiff
path: root/share/www/script/test
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2010-06-24 17:56:41 +0000
committerJohn Christopher Anderson <jchris@apache.org>2010-06-24 17:56:41 +0000
commit88caaddccbe40a148ffd83aab6fdd78b68442ecf (patch)
tree1fa2c79572f8a2bf97a64aa9dd2f9770260bf75e /share/www/script/test
parent5e852ddcb85429fbaf8003328104744aa00a98b0 (diff)
don't require a revpos attribute for stubs. closes COUCHDB-809 thanks Caleb Land
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@957653 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/test')
-rw-r--r--share/www/script/test/attachments.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/share/www/script/test/attachments.js b/share/www/script/test/attachments.js
index 36f5a5ad..322a4f50 100644
--- a/share/www/script/test/attachments.js
+++ b/share/www/script/test/attachments.js
@@ -244,4 +244,24 @@ couchTests.attachments= function(debug) {
body: "THIS IS AN ATTACHMENT. BOOYA!"
});
TEquals(400, xhr.status, "should return error code 400 Bad Request");
+
+ // test COUCHDB-809 - stubs should only require the 'stub' field
+ var bin_doc6 = {
+ _id: "bin_doc6",
+ _attachments:{
+ "foo.txt": {
+ content_type:"text/plain",
+ data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
+ }
+ }
+ }
+ var save_response = db.save(bin_doc6);
+ bin_doc6._rev = save_response["rev"];
+ // stub out the attachment
+ bin_doc6._attachments["foo.txt"] = { stub: true };
+
+ var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc6", {
+ body: JSON.stringify(bin_doc6)
+ });
+ TEquals(201, xhr.status, "should send 201 Created when attachment stub contains only the 'stub' field");
};