Permalink
Browse files

test for 1608

  • Loading branch information...
1 parent 79b54be commit 62528738ab251fb854b289e586291ddb45ad0736 @rnewson rnewson committed with benoitc Nov 21, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 apps/couch_httpd/share/www/script/test/update_documents.js
View
8 apps/couch_httpd/share/www/script/test/update_documents.js
@@ -87,6 +87,10 @@ couchTests.update_documents = function(debug) {
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" : {
@@ -215,6 +219,10 @@ couchTests.update_documents = function(debug) {
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"},

0 comments on commit 6252873

Please sign in to comment.