summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul J. Davis <paul.joseph.davis@gmail.com>2020-01-07 16:37:40 -0600
committerPaul J. Davis <paul.joseph.davis@gmail.com>2020-01-07 17:10:59 -0600
commit2e4f9d39169f3a5589bbde5c19695cbd151ee5d2 (patch)
treee71057b6abd65c259d29c59334ef73fe37e8125b
parentc6459fabfba13c8a85fbdbe12242f04126e0aab0 (diff)
downloadcouchdb-2e4f9d39169f3a5589bbde5c19695cbd151ee5d2.tar.gz
Set the session correctly
Adam K noticed that we aren't setting the session cookie correctly which appears to have made this test fail randomly. Why its random and not consistent is currently unknown.
-rw-r--r--test/elixir/test/cookie_auth_test.exs25
1 files changed, 8 insertions, 17 deletions
diff --git a/test/elixir/test/cookie_auth_test.exs b/test/elixir/test/cookie_auth_test.exs
index ac1110be2..b10ee84f1 100644
--- a/test/elixir/test/cookie_auth_test.exs
+++ b/test/elixir/test/cookie_auth_test.exs
@@ -95,12 +95,9 @@ defmodule CookieAuthTest do
session = use_session || login_as(user)
resp =
- Couch.get(
- "/#{db_name}/#{URI.encode(doc_id)}",
- headers: [
- Cookie: session.cookie,
- "X-CouchDB-www-Authenticate": "Cookie"
- ]
+ Couch.Session.get(
+ session,
+ "/#{db_name}/#{URI.encode(doc_id)}"
)
if use_session == nil do
@@ -125,12 +122,9 @@ defmodule CookieAuthTest do
session = use_session || login_as(user)
resp =
- Couch.put(
+ Couch.Session.put(
+ session,
"/#{db_name}/#{URI.encode(doc["_id"])}",
- headers: [
- Cookie: session.cookie,
- "X-CouchDB-www-Authenticate": "Cookie"
- ],
body: doc
)
@@ -160,12 +154,9 @@ defmodule CookieAuthTest do
session = use_session || login_as(user)
resp =
- Couch.delete(
- "/#{db_name}/#{URI.encode(doc["_id"])}",
- headers: [
- Cookie: session.cookie,
- "X-CouchDB-www-Authenticate": "Cookie"
- ]
+ Couch.Session.delete(
+ session,
+ "/#{db_name}/#{URI.encode(doc["_id"])}"
)
if use_session == nil do