COUCHDB-1483 - Update handlers must produce valid doc ids
diff --git a/script/test/update_documents.js b/script/test/update_documents.js
index b352bb4..bbaa07d 100644
--- a/script/test/update_documents.js
+++ b/script/test/update_documents.js
@@ -95,7 +95,10 @@
            "base64" : "aGVsbG8gd29ybGQh" // "hello world!" encoded
          };
          return [doc, resp];
-       })
+       }),
+      "empty" : stringFun(function(doc, req) {
+        return [{}, 'oops'];
+      })
     }
   };
   T(db.save(designDoc).ok);
@@ -221,4 +224,10 @@
   T(xhr.status == 201);
   T(xhr.responseText == "hello world!");
   T(/application\/octet-stream/.test(xhr.getResponseHeader("Content-Type")));
+
+  // Insert doc with empty id
+  xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/empty/foo");
+  TEquals(400, xhr.status);
+  TEquals("Document id must not be empty", JSON.parse(xhr.responseText).reason);
+
 };