summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorAdam Kocoloski <kocolosk@apache.org>2009-08-12 20:07:06 +0000
committerAdam Kocoloski <kocolosk@apache.org>2009-08-12 20:07:06 +0000
commit2ceb29752aa4cf638d947ffab3eb5759d306afa4 (patch)
tree3916a2adce46a0875cadc42dfd41cddc67f92a97 /share
parente10858cd53e9b2a1cf769d7d71e4c1adcf30b4f3 (diff)
rollback _conflicts view patch
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@803690 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share')
-rw-r--r--share/www/script/couch.js12
-rw-r--r--share/www/script/couch_tests.js1
-rw-r--r--share/www/script/test/view_builtin.js74
3 files changed, 2 insertions, 85 deletions
diff --git a/share/www/script/couch.js b/share/www/script/couch.js
index eba60ad5..e902a730 100644
--- a/share/www/script/couch.js
+++ b/share/www/script/couch.js
@@ -191,18 +191,10 @@ function CouchDB(name, httpHeaders) {
}
this.allDocs = function(options,keys) {
- return this.builtinView("_all_docs", options, keys)
- }
-
- this.conflicts = function(options,keys) {
- return this.builtinView("_conflicts", options, keys)
- }
-
- this.builtinView = function(name, options, keys) {
if(!keys) {
- this.last_req = this.request("GET", this.uri + name + encodeOptions(options));
+ this.last_req = this.request("GET", this.uri + "_all_docs" + encodeOptions(options));
} else {
- this.last_req = this.request("POST", this.uri + name + encodeOptions(options), {
+ this.last_req = this.request("POST", this.uri + "_all_docs" + encodeOptions(options), {
headers: {"Content-Type": "application/json"},
body: JSON.stringify({keys:keys})
});
diff --git a/share/www/script/couch_tests.js b/share/www/script/couch_tests.js
index 7ddfa312..802db6f8 100644
--- a/share/www/script/couch_tests.js
+++ b/share/www/script/couch_tests.js
@@ -51,7 +51,6 @@ loadTest("design_paths.js");
loadTest("content_negotiation.js");
loadTest("design_docs.js");
loadTest("invalid_docids.js");
-loadTest("view_builtin.js");
loadTest("view_collation.js");
loadTest("view_conflicts.js");
loadTest("view_errors.js");
diff --git a/share/www/script/test/view_builtin.js b/share/www/script/test/view_builtin.js
deleted file mode 100644
index c0f7b2e5..00000000
--- a/share/www/script/test/view_builtin.js
+++ /dev/null
@@ -1,74 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.view_builtin = function(debug) {
- var db = new CouchDB("test_suite_db");
- db.deleteDb();
- db.createDb();
- if (debug) debugger;
-
- // test _conflicts view
-
- // no rows
- var result = db.conflicts();
- TEquals(0, result.rows.length, "should return 0 conflicts");
-
- // one doc with a conflict
- var doc_a = db.save({_id:"a", a:1});
-
- // create conflict
- var bulk_result = db.bulkSave([{_id:"a",a:2}], {all_or_nothing:true});
- var result = db.conflicts();
- TEquals(1, result.rows.length, "should return 1 conflicts");
- TEquals("a", result.rows[0].id, "should return row id 'a'");
- TEquals("a", result.rows[0].key, "should return row key 'a'");
- TEquals(bulk_result[0].rev, result.rows[0].rev,
- "should return row key 'a'");
-
- // multiple docs with conflicts
- var doc_b = db.save({_id:"b", a:3});
- var bulk_result = db.bulkSave([{_id:"b",a:4}], {all_or_nothing:true});
- var result = db.conflicts();
- TEquals(2, result.rows.length, "should return 2 conflicts");
-
- // key, startkey, endkey, skip & count
- var result = db.conflicts({key:"b"});
- TEquals(1, result.rows.length, "should return 1 conflicts");
-
- var result = db.conflicts({startkey:"b"});
- TEquals(1, result.rows.length, "should return 1 conflicts");
-
- var result = db.conflicts({startkey:"a", endkey:"b"});
- TEquals(2, result.rows.length, "should return 2 conflicts");
-
- var result = db.conflicts({startkey:"c"});
- TEquals(0, result.rows.length, "should return 0 conflicts");
-
- var result = db.conflicts({limit:1});
- TEquals(1, result.rows.length, "should return 1 conflicts");
-
- var result = db.conflicts({skip:1});
- TEquals(1, result.rows.length, "should return 1 conflicts");
- TEquals("b", result.rows[0].key, "should return row key 'b'");
-
- // POST is not allowed yet
- try {
- var result = db.conflicts({}, ["a"]);
- } catch (e) {
- TEquals("method_not_allowed", e.error, "should not allow POST requests");
- }
-
- // multi key get
- // var result = db.conflicts({}, ["a"]);
- // TEquals(1, result.rows.length, "should return 1 conflicts");
- // TEquals("a", result.rows[0].key, "should return row key 'a'");
-};