From 88caaddccbe40a148ffd83aab6fdd78b68442ecf Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Thu, 24 Jun 2010 17:56:41 +0000 Subject: 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 --- share/www/script/test/attachments.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'share/www/script/test') 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"); }; -- cgit v1.2.3