summaryrefslogtreecommitdiff
path: root/share/www/script
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2009-01-30 01:40:38 +0000
committerJohn Christopher Anderson <jchris@apache.org>2009-01-30 01:40:38 +0000
commitbbd217f334475cd83eaaf24cda71100d4db0efb0 (patch)
tree8cae9e099ee04f887b8dd722ee07a987363d524b /share/www/script
parentdccb6fdd5f8f3fa7c9be6e4cca19586aa91d07a4 (diff)
POST to create docs returns a Location header. fixes COUCHDB-8
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@739133 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script')
-rw-r--r--share/www/script/couch_tests.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/share/www/script/couch_tests.js b/share/www/script/couch_tests.js
index a6c47a7d..89a979b4 100644
--- a/share/www/script/couch_tests.js
+++ b/share/www/script/couch_tests.js
@@ -140,6 +140,18 @@ var tests = {
// make sure we can still open
T(db.open(existingDoc._id, {rev: existingDoc._rev}) != null);
+
+ // test that the POST response has a Location header
+ var xhr = CouchDB.request("POST", "/test_suite_db", {
+ body: JSON.stringify({"foo":"bar"})
+ });
+ var resp = JSON.parse(xhr.responseText);
+ T(resp.ok);
+ var loc = xhr.getResponseHeader("Location");
+ T(loc, "should have a Location header");
+ var locs = loc.split('/');
+ T(locs[4] == resp.id);
+ T(locs[3] == "test_suite_db");
},
delayed_commits: function(debug) {