summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Nortier <bjnortier@gmail.com>2012-11-02 12:46:20 +0000
committerJan Lehnardt <jan@apache.org>2012-11-02 14:02:48 +0100
commitb9af7ea506ac95034a91951f29e1f4249ef4317c (patch)
treed8e5ec3066870036eeab56213f7e125f556b2807
parent4edbb93d2271ac1eb82f4d2bb072b8bdf6829f85 (diff)
downloadcouchdb-b9af7ea506ac95034a91951f29e1f4249ef4317c.tar.gz
Test the X-Couch-Id header
-rw-r--r--share/www/script/test/update_documents.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/share/www/script/test/update_documents.js b/share/www/script/test/update_documents.js
index bbaa07da7..1dc1b4e9c 100644
--- a/share/www/script/test/update_documents.js
+++ b/share/www/script/test/update_documents.js
@@ -107,6 +107,7 @@ couchTests.update_documents = function(debug) {
var resp = db.save(doc);
T(resp.ok);
var docid = resp.id;
+ T(equals(docid, db.last_req.getResponseHeader("X-Couch-Id")));
// update error
var xhr = CouchDB.request("POST", "/test_suite_db/_design/update/_update/");
@@ -117,7 +118,8 @@ couchTests.update_documents = function(debug) {
xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/hello/"+docid);
T(xhr.status == 201);
T(xhr.responseText == "<p>hello doc</p>");
- T(/charset=utf-8/.test(xhr.getResponseHeader("Content-Type")))
+ T(/charset=utf-8/.test(xhr.getResponseHeader("Content-Type")));
+ T(equals(docid, xhr.getResponseHeader("X-Couch-Id")));
doc = db.open(docid);
T(doc.world == "hello");