From 58251b581684923782f879e67b13361644592a37 Mon Sep 17 00:00:00 2001 From: Paul Joseph Davis Date: Sun, 16 Aug 2009 03:07:21 +0000 Subject: 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 --- share/www/script/test/basics.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'share/www') 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}) -- cgit v1.2.3