Permalink
Browse files

Test the X-Couch-Id header

  • Loading branch information...
bjnortier authored and janl committed Nov 2, 2012
1 parent 4edbb93 commit b9af7ea506ac95034a91951f29e1f4249ef4317c
Showing with 3 additions and 1 deletion.
  1. +3 −1 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");

0 comments on commit b9af7ea

Please sign in to comment.