summaryrefslogtreecommitdiff
path: root/rel/overlay/share/www/script/test/rewrite.js
diff options
context:
space:
mode:
Diffstat (limited to 'rel/overlay/share/www/script/test/rewrite.js')
-rw-r--r--rel/overlay/share/www/script/test/rewrite.js15
1 files changed, 12 insertions, 3 deletions
diff --git a/rel/overlay/share/www/script/test/rewrite.js b/rel/overlay/share/www/script/test/rewrite.js
index 66b33d74..ff2d3822 100644
--- a/rel/overlay/share/www/script/test/rewrite.js
+++ b/rel/overlay/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");
+
+}