couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jch...@apache.org
Subject svn commit: r885533 - /couchdb/trunk/share/www/script/test/changes.js
Date Mon, 30 Nov 2009 18:52:33 GMT
Author: jchris
Date: Mon Nov 30 18:52:33 2009
New Revision: 885533

URL: http://svn.apache.org/viewvc?rev=885533&view=rev
Log:
passing test for filtered continuous changes

Modified:
    couchdb/trunk/share/www/script/test/changes.js

Modified: couchdb/trunk/share/www/script/test/changes.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/test/changes.js?rev=885533&r1=885532&r2=885533&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/test/changes.js (original)
+++ couchdb/trunk/share/www/script/test/changes.js Mon Nov 30 18:52:33 2009
@@ -219,6 +219,17 @@
     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 @@
   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(



Mime
View raw message