From f390e1bbc4d5132a4e869e25299fe10e2210f6d4 Mon Sep 17 00:00:00 2001 From: Tristan Cavelier <tristan.cavelier@tiolive.com> Date: Fri, 1 Feb 2013 14:51:19 +0100 Subject: [PATCH] Revision storage put tests updated: save document ok even if rev is not provided --- test/jiotests.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/jiotests.js b/test/jiotests.js index 7cd0391..be3460a 100644 --- a/test/jiotests.js +++ b/test/jiotests.js @@ -1376,11 +1376,17 @@ test ("Put", function(){ "Check document tree" ); - // put and document already exists - o.spy (o, "status", 409, "Update the document"); - o.jio.put({"_id": "put1", "title": "myPut2"}, o.f); + // put without rev and document already exists + o.doc = {"_id": "put1", "title": "myPut2"}; + o.rev = "1-"+generateRevisionHash(o.doc, o.revisions); + o.spy (o, "value", {"ok": true, "id": "put1", "rev": o.rev}, + "Put same document without revision"); + o.jio.put(o.doc, o.f); o.tick(o); + o.doc_tree.children.unshift({ + "rev": o.rev, "status": "available", "children": [] + }); // put + revision o.doc = {"_id": "put1", "_rev": o.rev, "title": "myPut2"}; -- 2.30.9