You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2012/12/04 21:43:49 UTC

[25/44] git commit: Test the X-Couch-Id header

Test the X-Couch-Id header


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/31b58e5b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/31b58e5b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/31b58e5b

Branch: refs/heads/1368-fix-multipart-header-parts
Commit: 31b58e5b5d7eb9411194c2bcfe2ee45d79e1a4aa
Parents: 4e18193
Author: Benjamin Nortier <bj...@gmail.com>
Authored: Fri Nov 2 12:46:20 2012 +0000
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Thu Nov 8 23:37:33 2012 +0100

----------------------------------------------------------------------
 share/www/script/test/update_documents.js |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/31b58e5b/share/www/script/test/update_documents.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/update_documents.js b/share/www/script/test/update_documents.js
index bbaa07d..1dc1b4e 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");