You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by jh...@apache.org on 2012/02/29 12:09:58 UTC
[4/9] git commit: Move to a strictly hostname:port vhost key
Move to a strictly hostname:port vhost key
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/1bc8c493
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/1bc8c493
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/1bc8c493
Branch: refs/heads/COUCHDB-1416
Commit: 1bc8c493accf71fcf06418e46aadd36bdc2a42df
Parents: 0ab41ad
Author: Jason Smith (air) <jh...@apache.org>
Authored: Wed Feb 29 16:58:35 2012 +0700
Committer: Jason Smith (air) <jh...@apache.org>
Committed: Wed Feb 29 16:58:35 2012 +0700
----------------------------------------------------------------------
share/www/script/test/rewrite.js | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/1bc8c493/share/www/script/test/rewrite.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/rewrite.js b/share/www/script/test/rewrite.js
index 36ab87e..0262bb6 100644
--- a/share/www/script/test/rewrite.js
+++ b/share/www/script/test/rewrite.js
@@ -443,7 +443,7 @@ couchTests.rewrite = function(debug) {
var rw_ddoc = {
_id: "_design/rwtest",
rewrites: [
- {"from":"testShow","to":"_show/show_requested_path"},
+ {"from":"path/testShow","to":"_show/show_requested_path"},
{"from":"_config/*","to":"../../../_config/*"}
],
shows : {
@@ -456,13 +456,13 @@ couchTests.rewrite = function(debug) {
T(db.save(rw_ddoc).ok);
// try accessing directly
- var res = CouchDB.request("GET", "/test_suite_db/_design/rwtest/_rewrite/testShow");
- TEquals('/test_suite_db/_design/rwtest/_rewrite/testShow',
+ var res = CouchDB.request("GET", "/test_suite_db/_design/rwtest/_rewrite/path/testShow");
+ TEquals('/test_suite_db/_design/rwtest/_rewrite/path/testShow',
res.responseText, "requested_path should equal requested");
- // test a vhost with a path as well
+ // Test on a typical vhost -> _rewrite setup.
var vhosts = {section:'vhosts',
- key:encodeURIComponent(CouchDB.host + '/path'),
+ key:encodeURIComponent(CouchDB.host),
value:"/test_suite_db/_design/rwtest/_rewrite/"};
run_on_modified_server([vhosts], function() {
@@ -470,8 +470,8 @@ couchTests.rewrite = function(debug) {
TEquals('/path/testShow', res.responseText, "requested_path should equal requested");
});
- // test a vhost on the root of the host
- vhosts.key = encodeURIComponent(CouchDB.host);
+ // Test a vhost to a path within the rewrite namespace.
+ vhosts.value = "/test_suite_db/_design/rwtest/_rewrite/path";
run_on_modified_server([vhosts], function() {
var res = CouchDB.request("GET", "/testShow");
TEquals('/testShow', res.responseText, "requested_path should equal requested");