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/11/02 14:02:55 UTC

[3/3] 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/b9af7ea5
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/b9af7ea5
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/b9af7ea5

Branch: refs/heads/master
Commit: b9af7ea506ac95034a91951f29e1f4249ef4317c
Parents: 4edbb93
Author: Benjamin Nortier <bj...@gmail.com>
Authored: Fri Nov 2 12:46:20 2012 +0000
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Fri Nov 2 14:02:48 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/b9af7ea5/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");