test for 1608
diff --git a/script/test/update_documents.js b/script/test/update_documents.js
index bbaa07d..6a318fd 100644
--- a/script/test/update_documents.js
+++ b/script/test/update_documents.js
@@ -87,6 +87,10 @@
resp = {"code": 302}
return [null, resp];
}),
+ "resp-code-and-json" : stringFun(function(doc,req) {
+ resp = {"code": 302, "json": {"ok": true}}
+ return [{"_id": req["uuid"]}, resp];
+ }),
"binary" : stringFun(function(doc, req) {
var resp = {
"headers" : {
@@ -216,6 +220,10 @@
xhr = CouchDB.request("POST", "/test_suite_db/_design/update/_update/resp-code/");
T(xhr.status == 302);
+ xhr = CouchDB.request("POST", "/test_suite_db/_design/update/_update/resp-code-and-json/");
+ TEquals(302, xhr.status);
+ T(JSON.parse(xhr.responseText).ok);
+
// base64 response
xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/binary/"+docid, {
headers : {"X-Couch-Full-Commit":"false"},