summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2008-10-10 02:23:11 +0000
committerJohn Christopher Anderson <jchris@apache.org>2008-10-10 02:23:11 +0000
commit6b5676f0929b5f5da3e37e985484494bf3675b94 (patch)
treee63aea190560882e4ce7833bc1a2979ae37be35d /share
parent074180cff70b4687bb9619a76987ced7e711d1c5 (diff)
config web service fix from davisp
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@703315 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share')
-rw-r--r--share/www/script/couch_tests.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/share/www/script/couch_tests.js b/share/www/script/couch_tests.js
index e88c68d1..0339dda6 100644
--- a/share/www/script/couch_tests.js
+++ b/share/www/script/couch_tests.js
@@ -1857,6 +1857,36 @@ var tests = {
T(rows[(2*(i-4))+1].key == i+1);
}
T(db.view("test/single_doc").total_rows == 0);
+ },
+
+ config : function(debug) {
+ var db = new CouchDB("test_suite_db");
+ db.deleteDb();
+ db.createDb();
+ if (debug) debugger;
+
+ // test that /_config returns all the settings
+ var xhr = CouchDB.request("GET", "/_config");
+ var config = JSON.parse(xhr.responseText);
+ T(config.couchdb.database_dir);
+ T(config.httpd.port == CouchDB.port);
+ T(config.daemons.httpd);
+ T(config.httpd_global_handlers._config);
+ T(config.log.level);
+ T(config.query_servers.javascript);
+
+ // test that settings can be altered
+ xhr = CouchDB.request("PUT", "/_config/test/foo",{
+ body : "bar"
+ });
+ T(xhr.status == 200);
+ xhr = CouchDB.request("GET", "/_config/test");
+ config = JSON.parse(xhr.responseText);
+ T(config.foo == "bar");
+
+ // you can get a single key
+ xhr = CouchDB.request("GET", "/_config/test/foo");
+ T(xhr.responseText == '"bar"');
}
};