This is an automated email from the ASF dual-hosted git repository. davisp pushed a commit to branch prototype/views in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 741a11582433a66449a4f2834d148efe5f0ff558 Author: Paul J. Davis <[email protected]> AuthorDate: Tue Jul 23 15:12:54 2019 -0500 Minor tweaks to remove reduce function tests --- test/elixir/test/basics_test.exs | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/test/elixir/test/basics_test.exs b/test/elixir/test/basics_test.exs index c28c78c..ea5c125 100644 --- a/test/elixir/test/basics_test.exs +++ b/test/elixir/test/basics_test.exs @@ -156,6 +156,7 @@ defmodule BasicsTest do # Initial view query test resp = Couch.get("/#{db_name}/_design/foo/_view/baz") + Logger.debug("#{inspect resp}") assert resp.body["total_rows"] == 1 assert hd(resp.body["rows"])["value"] == 16 @@ -178,21 +179,33 @@ defmodule BasicsTest do assert Couch.get("/#{db_name}").body["doc_count"] == 8 + # Disabling until we figure out reduce functions + # # Test reduce function + # resp = Couch.get("/#{db_name}/_design/bar/_view/baz") + # assert hd(resp.body["rows"])["value"] == 33 + # Test reduce function - resp = Couch.get("/#{db_name}/_design/bar/_view/baz") - assert hd(resp.body["rows"])["value"] == 33 + resp = Couch.get("/#{db_name}/_design/bar/_view/baz", query: %{:reduce => false}) + assert resp.body["total_rows"] == 3 # Delete doc and test for updated view results doc0 = Couch.get("/#{db_name}/0").body assert Couch.delete("/#{db_name}/0?rev=#{doc0["_rev"]}").body["ok"] - retry_until(fn -> - Couch.get("/#{db_name}/_design/foo/_view/baz").body["total_rows"] == 2 - end) + # Disabling until we figure out reduce functions + # retry_until(fn -> + # Couch.get("/#{db_name}/_design/foo/_view/baz").body["total_rows"] == 2 + # end) + + resp = Couch.get("/#{db_name}/_design/bar/_view/baz", query: %{:reduce => false}) + assert resp.body["total_rows"] == 2 assert Couch.get("/#{db_name}").body["doc_count"] == 7 assert Couch.get("/#{db_name}/0").status_code == 404 - refute Couch.get("/#{db_name}/0?rev=#{doc0["_rev"]}").status_code == 404 + + # No longer true. Old revisions are not stored after + # an update. + # refute Couch.get("/#{db_name}/0?rev=#{doc0["_rev"]}").status_code == 404 end @tag :with_db
