diff options
author | Paul Joseph Davis <davisp@apache.org> | 2009-08-16 03:07:21 +0000 |
---|---|---|
committer | Paul Joseph Davis <davisp@apache.org> | 2009-08-16 03:07:21 +0000 |
commit | 58251b581684923782f879e67b13361644592a37 (patch) | |
tree | 6537b96e831e213432340c86aa1ad6486d456fb8 /share | |
parent | 3975b8758a6aa58389a74eba15e1908ef86465d8 (diff) |
Make POST's reflect a provided _id member.
Fixes COUCHDB-468
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@804555 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share')
-rw-r--r-- | share/www/script/test/basics.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/share/www/script/test/basics.js b/share/www/script/test/basics.js index 3979d860..34d0f38e 100644 --- a/share/www/script/test/basics.js +++ b/share/www/script/test/basics.js @@ -161,6 +161,16 @@ couchTests.basics = function(debug) { T(locs[4] == resp.id); T(locs[3] == "test_suite_db"); + // test that that POST's with an _id aren't overriden with a UUID. + var xhr = CouchDB.request("POST", "/test_suite_db", { + body: JSON.stringify({"_id": "oppossum", "yar": "matey"}) + }); + var resp = JSON.parse(xhr.responseText); + T(resp.ok); + T(resp.id == "oppossum"); + var doc = db.open("oppossum"); + T(doc.yar == "matey"); + // document put's should return a Location header var xhr = CouchDB.request("PUT", "/test_suite_db/newdoc", { body: JSON.stringify({"a":1}) |