summaryrefslogtreecommitdiff
path: root/share/www/script/test
diff options
context:
space:
mode:
Diffstat (limited to 'share/www/script/test')
-rw-r--r--share/www/script/test/rewrite.js15
1 files changed, 12 insertions, 3 deletions
diff --git a/share/www/script/test/rewrite.js b/share/www/script/test/rewrite.js
index 66b33d74..ff2d3822 100644
--- a/share/www/script/test/rewrite.js
+++ b/share/www/script/test/rewrite.js
@@ -365,7 +365,16 @@ couchTests.rewrite = function(debug) {
T(result.uuids.length == 1);
var first = result.uuids[0];
});
-
});
-
-} \ No newline at end of file
+
+ // test invalid rewrites
+ // string
+ var ddoc = {
+ _id: "_design/invalid",
+ rewrites: "[{\"from\":\"foo\",\"to\":\"bar\"}]"
+ }
+ db.save(ddoc);
+ var res = CouchDB.request("GET", "/test_suite_db/_design/invalid/_rewrite/foo");
+ TEquals(400, res.status, "should return 400");
+
+}