From b232effb7b51c831c0eccfb553514bd2b0c41c0b Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Mon, 30 Nov 2009 18:52:33 +0000 Subject: passing test for filtered continuous changes git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@885533 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/test/changes.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'share/www/script/test') diff --git a/share/www/script/test/changes.js b/share/www/script/test/changes.js index fe18f2d1..fb9d724e 100644 --- a/share/www/script/test/changes.js +++ b/share/www/script/test/changes.js @@ -219,6 +219,17 @@ couchTests.changes = function(debug) { var resp = JSON.parse(xhr.responseText); T(resp.last_seq == 9); T(resp.results && resp.results.length > 0 && resp.results[0]["id"] == id, "filter the correct update"); + + // filter with continuous + xhr = CouchDB.newXhr(); + xhr.open("GET", "/test_suite_db/_changes?feed=continuous&filter=changes_filter/bop&timeout=100", true); + xhr.send(""); + db.save({"_id":"rusty", "bop" : "plankton"}); + sleep(200); + var lines = xhr.responseText.split("\n"); + T(JSON.parse(lines[1]).id == id); + T(JSON.parse(lines[2]).id == "rusty"); + T(JSON.parse(lines[3]).last_seq == 10); } // error conditions @@ -246,7 +257,7 @@ couchTests.changes = function(debug) { var req = CouchDB.request("GET", "/test_suite_db/_changes?filter=changes_filter/bop&style=all_docs"); var resp = JSON.parse(req.responseText); - TEquals(2, resp.results.length, "should return two rows"); + TEquals(3, resp.results.length, "should return matching rows"); // test for userCtx run_on_modified_server( -- cgit v1.2.3