From 9d93a3ee880bc1a64e9c3e6141c517ed4295661c Mon Sep 17 00:00:00 2001 From: Jan Lehnardt Date: Tue, 13 Sep 2011 18:54:31 +0000 Subject: Allow slashes in doc ids in URLs to _update handlers. This mirrors the behaviour of the _show API. Patch by Christopher Bonhage. Closes COUCHDB-1229 git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1170299 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/test/update_documents.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'share/www/script/test') diff --git a/share/www/script/test/update_documents.js b/share/www/script/test/update_documents.js index 49d3b68a..4d2b29fc 100644 --- a/share/www/script/test/update_documents.js +++ b/share/www/script/test/update_documents.js @@ -165,4 +165,18 @@ couchTests.update_documents = function(debug) { T(xhr.status == 200); T(xhr.responseText.length == 32); + // COUCHDB-1229 - allow slashes in doc ids for update handlers + // /db/_design/doc/_update/handler/doc/id + + var doc = { + _id:"with/slash", + counter:1 + }; + db.save(doc); + xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/bump-counter/with/slash"); + TEquals(201, xhr.status, "should return a 200 status"); + TEquals("

bumped it!

", xhr.responseText, "should report bumping"); + + var doc = db.open("with/slash"); + TEquals(2, doc.counter, "counter should be 2"); }; -- cgit v1.2.3