This is an automated email from the ASF dual-hosted git repository. davisp pushed a commit to branch fix-elixir-cookie-auth-test in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 589b05bfd1b0457bd99d1b26091838c08ec89a45 Author: Paul J. Davis <[email protected]> AuthorDate: Tue Jan 7 16:37:40 2020 -0600 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. --- test/elixir/test/cookie_auth_test.exs | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/test/elixir/test/cookie_auth_test.exs b/test/elixir/test/cookie_auth_test.exs index ac1110b..b10ee84 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
