From ba94c9c5c85c82804faa91d8d2938539168ea965 Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Mon, 4 May 2009 22:25:23 +0000 Subject: standalone attachment GETs should respect "rev" qs param git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@771474 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/test/attachments.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'share/www/script/test') diff --git a/share/www/script/test/attachments.js b/share/www/script/test/attachments.js index d9560bce..ec59eda4 100644 --- a/share/www/script/test/attachments.js +++ b/share/www/script/test/attachments.js @@ -117,9 +117,15 @@ couchTests.attachments= function(debug) { var xhr = CouchDB.request("DELETE", "/test_suite_db/bin_doc3/attachment.txt?rev=" + rev); T(xhr.status == 200); - var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc3/attachment.txt?rev=" + rev); + var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc3/attachment.txt"); T(xhr.status == 404); + // deleted attachment is still accessible with revision + var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc3/attachment.txt?rev=" + rev); + T(xhr.status == 200); + T(xhr.responseText == bin_data); + T(xhr.getResponseHeader("Content-Type") == "text/plain;charset=utf-8"); + // empty attachments var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc4/attachment.txt", { headers:{"Content-Type":"text/plain;charset=utf-8"}, -- cgit v1.2.3