diff options
author | Eric Avdey <eiri@eiri.ca> | 2019-01-21 16:42:10 -0400 |
---|---|---|
committer | Eric Avdey <eiri@eiri.ca> | 2019-01-21 17:15:17 -0400 |
commit | 841de8c6a917a24fcbbc72e1ef694076e8eac82b (patch) | |
tree | ca0187e59f98687725b6560ca45c8876137b95f3 | |
parent | 666ae213277102bb2ab8399cab10b614643cb67a (diff) | |
download | couchdb-841de8c6a917a24fcbbc72e1ef694076e8eac82b.tar.gz |
Add a test for a doc read with etag
-rw-r--r-- | test/elixir/test/basics_test.exs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/elixir/test/basics_test.exs b/test/elixir/test/basics_test.exs index 98b7e63cb..8fc0b1d70 100644 --- a/test/elixir/test/basics_test.exs +++ b/test/elixir/test/basics_test.exs @@ -85,6 +85,17 @@ defmodule BasicsTest do end @tag :with_db + test "A document read with etag works", context do + db_name = context[:db_name] + {:ok, resp} = create_doc(db_name, sample_doc_foo()) + etag = ~s("#{resp.body["rev"]}") + resp = Couch.get("/#{db_name}/foo", headers: ["If-None-Match": etag]) + assert resp.status_code == 304, "Should be 304 Not Modified" + assert resp.headers[:"Content-Length"] == "0", "Should have zero content length" + assert resp.body == "", "Should have an empty body" + end + + @tag :with_db test "Make sure you can do a seq=true option", context do db_name = context[:db_name] {:ok, _} = create_doc(db_name, sample_doc_foo()) |