diff options
author | Jan Lehnardt <jan@apache.org> | 2011-09-13 18:54:31 +0000 |
---|---|---|
committer | Jan Lehnardt <jan@apache.org> | 2011-09-13 18:54:31 +0000 |
commit | 9d93a3ee880bc1a64e9c3e6141c517ed4295661c (patch) | |
tree | 28668fa1120e5789f68c52d983cd949afecce8ad /share | |
parent | fb94d04c2dd4a9b39f1e961d4509bf07b07834ef (diff) |
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
Diffstat (limited to 'share')
-rw-r--r-- | share/www/script/test/update_documents.js | 14 |
1 files changed, 14 insertions, 0 deletions
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("<h1>bumped it!</h1>", xhr.responseText, "should report bumping"); + + var doc = db.open("with/slash"); + TEquals(2, doc.counter, "counter should be 2"); }; |