From 0ca05bd05b5a87b8cb654e6df110e063c94a0808 Mon Sep 17 00:00:00 2001 From: Joel Speed Date: Thu, 16 May 2019 17:13:14 +0100 Subject: [PATCH] Tranfser all cookies in tests --- pkg/sessions/session_store_test.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pkg/sessions/session_store_test.go b/pkg/sessions/session_store_test.go index 47780f6..ff074e2 100644 --- a/pkg/sessions/session_store_test.go +++ b/pkg/sessions/session_store_test.go @@ -115,8 +115,9 @@ var _ = Describe("NewSessionStore", func() { err := ss.Save(saveResp, req, session) Expect(err).ToNot(HaveOccurred()) - resultCookie := saveResp.Result().Cookies()[0] - request.AddCookie(resultCookie) + for _, c := range saveResp.Result().Cookies() { + request.AddCookie(c) + } err = ss.Clear(response, request) Expect(err).ToNot(HaveOccurred()) }) @@ -177,14 +178,18 @@ var _ = Describe("NewSessionStore", func() { err := ss.Save(saveResp, req, session) Expect(err).ToNot(HaveOccurred()) - resultCookie := saveResp.Result().Cookies()[0] - request.AddCookie(resultCookie) + resultCookies := saveResp.Result().Cookies() + for _, c := range resultCookies { + request.AddCookie(c) + } err = ss.Clear(response, request) Expect(err).ToNot(HaveOccurred()) // The following should only be for server stores loadReq := httptest.NewRequest("GET", "http://example.com/", nil) - loadReq.AddCookie(resultCookie) + for _, c := range resultCookies { + loadReq.AddCookie(c) + } loadedAfterClear, err = ss.Load(loadReq) })