diff options
author | Paul J. Davis <paul.joseph.davis@gmail.com> | 2020-01-07 16:37:40 -0600 |
---|---|---|
committer | Paul J. Davis <paul.joseph.davis@gmail.com> | 2020-01-07 17:10:59 -0600 |
commit | 2e4f9d39169f3a5589bbde5c19695cbd151ee5d2 (patch) | |
tree | e71057b6abd65c259d29c59334ef73fe37e8125b | |
parent | c6459fabfba13c8a85fbdbe12242f04126e0aab0 (diff) | |
download | couchdb-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.exs | 25 |
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 |