summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorDamien F. Katz <damien@apache.org>2010-06-25 05:18:28 +0000
committerDamien F. Katz <damien@apache.org>2010-06-25 05:18:28 +0000
commita3886989b9e09ca5d01e18f1e39e9dae0f280530 (patch)
tree1b9525d923dfc79583ca3946de92536b1f2243ab /share
parentea1ffd94840e79bac252893741e43412aaca96e6 (diff)
Added checking to ensure when a revpos is sent with a stub, it's correct.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@957800 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share')
-rw-r--r--share/www/script/test/attachments.js20
1 files changed, 13 insertions, 7 deletions
diff --git a/share/www/script/test/attachments.js b/share/www/script/test/attachments.js
index 322a4f50..9d89d5d0 100644
--- a/share/www/script/test/attachments.js
+++ b/share/www/script/test/attachments.js
@@ -255,13 +255,19 @@ couchTests.attachments= function(debug) {
}
}
}
- var save_response = db.save(bin_doc6);
- bin_doc6._rev = save_response["rev"];
+ T(db.save(bin_doc6).ok);
// stub out the attachment
bin_doc6._attachments["foo.txt"] = { stub: true };
-
- var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc6", {
- body: JSON.stringify(bin_doc6)
- });
- TEquals(201, xhr.status, "should send 201 Created when attachment stub contains only the 'stub' field");
+ T(db.save(bin_doc6).ok == true);
+
+ // wrong rev pos specified
+
+ // stub out the attachment with the wrong revpos
+ bin_doc6._attachments["foo.txt"] = { stub: true, revpos: 10};
+ try {
+ T(db.save(bin_doc6).ok == true);
+ T(false && "Shouldn't get here!");
+ } catch (e) {
+ T(e.error == "missing_stub")
+ }
};