This is an automated email from the ASF dual-hosted git repository.

jiahuili430 pushed a commit to branch fix-elixir-tests
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 701281e8bddb284577f2fd9abd349878f27df180
Author: Jiahui Li <[email protected]>
AuthorDate: Thu Dec 11 14:37:37 2025 -0600

    Fix tests
---
 test/elixir/test/cluster_with_quorum_test.exs    | 20 +++++++-------
 test/elixir/test/cluster_without_quorum_test.exs | 33 ++++++++++++------------
 2 files changed, 27 insertions(+), 26 deletions(-)

diff --git a/test/elixir/test/cluster_with_quorum_test.exs 
b/test/elixir/test/cluster_with_quorum_test.exs
index fc3b28a0b..718e3f41b 100644
--- a/test/elixir/test/cluster_with_quorum_test.exs
+++ b/test/elixir/test/cluster_with_quorum_test.exs
@@ -7,14 +7,14 @@ defmodule WithQuorumTest do
   Test CouchDB API in a cluster without quorum.
   """
   @tag :with_db_name
-  test "Creating/Deleting DB should return 201-Created/202-Acepted", context do
+  test "Creating/Deleting DB should return 201-Created/200-OK", context do
     db_name = context[:db_name]
     resp = Couch.put("/#{db_name}")
     msg = "Should return 201-Created"
     assert resp.status_code in [201, 202], msg
     resp = Couch.delete("/#{db_name}")
-    msg = "Should return 202-Acepted"
-    assert resp.status_code == 202, msg
+    msg = "Should return 200-OK"
+    assert resp.status_code == 200, msg
   end
 
   @tag :with_db_name
@@ -45,7 +45,7 @@ defmodule WithQuorumTest do
   end
 
   @tag :with_db_name
-  test "Creating-Updating/Deleting doc with overriden quorum should return 
202-Acepted/200-OK",
+  test "Creating-Updating/Deleting doc with overridden quorum should return 
202-Accepted/200-OK",
        context do
     db_name = context[:db_name]
     Couch.put("/#{db_name}")
@@ -57,7 +57,7 @@ defmodule WithQuorumTest do
         body: %{:_id => "0", :a => 1}
       )
 
-    msg = "Should return 202-Acepted"
+    msg = "Should return 202-Accepted"
     assert resp.status_code == 202, msg
 
     resp = Couch.get("/#{context[:db_name]}/0")
@@ -70,7 +70,7 @@ defmodule WithQuorumTest do
         body: %{:_id => "0", :_rev => rev, :a => 2}
       )
 
-    msg = "Should return 202-Acepted"
+    msg = "Should return 202-Accepted"
     assert resp.status_code == 202, msg
 
     resp = Couch.get("/#{context[:db_name]}/0")
@@ -114,12 +114,12 @@ defmodule WithQuorumTest do
   end
 
   @tag :with_db_name
-  test "Bulk docs overriden quorum should return 202-Acepted", context do
+  test "Bulk docs overridden quorum should return 202-Accepted", context do
     db_name = context[:db_name]
     Couch.put("/#{db_name}")
     docs = create_docs(@doc_range)
     resp = Couch.post("/#{db_name}/_bulk_docs", query: %{:w => 3}, body: 
%{docs: docs})
-    msg = "Should return 202-Acepted"
+    msg = "Should return 202-Accepted"
     assert resp.status_code == 202, msg
 
     Couch.delete("/#{db_name}")
@@ -152,7 +152,7 @@ defmodule WithQuorumTest do
   end
 
   @tag :with_db_name
-  test "Attachments overriden quorum should return 202-Acepted", context do
+  test "Attachments overridden quorum should return 202-Accepted", context do
     db_name = context[:db_name]
     Couch.put("/#{db_name}")
     resp = Couch.post("/#{context[:db_name]}", body: %{:_id => "0"})
@@ -166,7 +166,7 @@ defmodule WithQuorumTest do
         headers: ["Content-Type": "text/plain;charset=utf-8"]
       )
 
-    msg = "Should return 202-Acepted"
+    msg = "Should return 202-Accepted"
     assert resp.status_code == 202, msg
 
     rev = resp.body["rev"]
diff --git a/test/elixir/test/cluster_without_quorum_test.exs 
b/test/elixir/test/cluster_without_quorum_test.exs
index f80b6ac27..f394220b2 100644
--- a/test/elixir/test/cluster_without_quorum_test.exs
+++ b/test/elixir/test/cluster_without_quorum_test.exs
@@ -7,23 +7,24 @@ defmodule WithoutQuorumTest do
   Test CouchDB API in a cluster without quorum.
   """
   @tag :with_db_name
-  test "Creating/Deleting DB should return 202-Accepted", context do
+  test "Creating/Deleting DB should return 201-Created/200-OK", context do
     db_name = context[:db_name]
     resp = Couch.put("/#{db_name}")
-    msg = "Should return 202-Accepted"
-    assert resp.status_code == 202, msg
+    msg = "Should return 201-Created"
+    assert resp.status_code == 201, msg
     resp = Couch.delete("/#{db_name}")
-    assert resp.status_code == 202, msg
+    msg = "Should return 200-OK"
+    assert resp.status_code == 200, msg
   end
 
   @tag :with_db_name
-  test "Creating/Updating/Deleting doc should return 202-Accepted", context do
+  test "Creating/Updating/Deleting doc should return 201-Created", context do
     db_name = context[:db_name]
     Couch.put("/#{db_name}")
 
     resp = Couch.post("/#{context[:db_name]}", body: %{:_id => "0", :a => 1})
-    msg = "Should return 202-Accepted"
-    assert resp.status_code == 202, msg
+    msg = "Should return 201-Created"
+    assert resp.status_code == 201, msg
 
     resp = Couch.get("/#{context[:db_name]}/0")
     rev = resp.body["_rev"]
@@ -82,7 +83,7 @@ defmodule WithoutQuorumTest do
   end
 
   @tag :with_db_name
-  test "Copy doc should return 202-Accepted", context do
+  test "Copy doc should return 201-Created", context do
     db_name = context[:db_name]
     Couch.put("/#{db_name}")
 
@@ -93,21 +94,21 @@ defmodule WithoutQuorumTest do
 
     headers = [Destination: "1"]
     resp = Couch.request(:copy, "/#{context[:db_name]}/0", headers: headers)
-    msg = "Should return 202-Accepted"
-    assert resp.status_code == 202, msg
+    msg = "Should return 201-Created"
+    assert resp.status_code == 201, msg
     Couch.delete("/#{db_name}")
   end
 
   @doc_range 1..5
 
   @tag :with_db_name
-  test "Bulk docs should return 202-Accepted", context do
+  test "Bulk docs should return 201-Created", context do
     db_name = context[:db_name]
     Couch.put("/#{db_name}")
     docs = create_docs(@doc_range)
     resp = Couch.post("/#{db_name}/_bulk_docs", body: %{docs: docs})
-    msg = "Should return 202-Accepted"
-    assert resp.status_code == 202, msg
+    msg = "Should return 201-Created"
+    assert resp.status_code == 201, msg
 
     Couch.delete("/#{db_name}")
   end
@@ -125,7 +126,7 @@ defmodule WithoutQuorumTest do
   end
 
   @tag :with_db_name
-  test "Attachments should return 202-Accepted", context do
+  test "Attachments should return 201-Created", context do
     db_name = context[:db_name]
     Couch.put("/#{db_name}")
     resp = Couch.post("/#{context[:db_name]}", body: %{:_id => "0"})
@@ -139,8 +140,8 @@ defmodule WithoutQuorumTest do
         headers: ["Content-Type": "text/plain;charset=utf-8"]
       )
 
-    msg = "Should return 202-Accepted"
-    assert resp.status_code == 202, msg
+    msg = "Should return 201-Created"
+    assert resp.status_code == 201, msg
 
     rev = resp.body["rev"]
     resp = Couch.delete("/#{context[:db_name]}/0/foo.txt", query: %{:rev => 
rev})

Reply via email to