summaryrefslogtreecommitdiff
path: root/share/www/script/test/changes.js
diff options
context:
space:
mode:
authorAdam Kocoloski <kocolosk@apache.org>2009-08-28 01:10:42 +0000
committerAdam Kocoloski <kocolosk@apache.org>2009-08-28 01:10:42 +0000
commit4b900a07dd82c94d87f873cf0b2a7e0a77cbf7b1 (patch)
treea6644b931f5b22894894a37d0757c62bbc88cb84 /share/www/script/test/changes.js
parent5160a2e57ab54131f88682fb2f949570fd6da091 (diff)
guard against non-existing filters in _changes
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@808716 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/test/changes.js')
-rw-r--r--share/www/script/test/changes.js20
1 files changed, 19 insertions, 1 deletions
diff --git a/share/www/script/test/changes.js b/share/www/script/test/changes.js
index 1adfaa1b..314a52b5 100644
--- a/share/www/script/test/changes.js
+++ b/share/www/script/test/changes.js
@@ -188,7 +188,25 @@ couchTests.changes = function(debug) {
req = CouchDB.request("GET", "/test_suite_db/_changes?filter=changes_filter/dynamic&field=bop");
resp = JSON.parse(req.responseText);
T(resp.results.length == 1);
-
+
+ // error conditions
+
+ // non-existing design doc
+ var req = CouchDB.request("GET",
+ "/test_suite_db/_changes?filter=nothingtosee/bop");
+ TEquals(400, req.status, "should return 400 for non existant design doc");
+
+ // non-existing filter
+ var req = CouchDB.request("GET",
+ "/test_suite_db/_changes?filter=changes_filter/movealong");
+ TEquals(400, req.status, "should return 400 for non existant filter fun");
+
+ // both
+ var req = CouchDB.request("GET",
+ "/test_suite_db/_changes?filter=nothingtosee/movealong");
+ TEquals(400, req.status,
+ "should return 400 for non existant design doc and filter fun");
+
// changes get all_docs style with deleted docs
var doc = {a:1};
db.save(doc);