Tranfser all cookies in tests
This commit is contained in:
parent
e179741b21
commit
0ca05bd05b
@ -115,8 +115,9 @@ var _ = Describe("NewSessionStore", func() {
|
|||||||
err := ss.Save(saveResp, req, session)
|
err := ss.Save(saveResp, req, session)
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
|
|
||||||
resultCookie := saveResp.Result().Cookies()[0]
|
for _, c := range saveResp.Result().Cookies() {
|
||||||
request.AddCookie(resultCookie)
|
request.AddCookie(c)
|
||||||
|
}
|
||||||
err = ss.Clear(response, request)
|
err = ss.Clear(response, request)
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
})
|
})
|
||||||
@ -177,14 +178,18 @@ var _ = Describe("NewSessionStore", func() {
|
|||||||
err := ss.Save(saveResp, req, session)
|
err := ss.Save(saveResp, req, session)
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
|
|
||||||
resultCookie := saveResp.Result().Cookies()[0]
|
resultCookies := saveResp.Result().Cookies()
|
||||||
request.AddCookie(resultCookie)
|
for _, c := range resultCookies {
|
||||||
|
request.AddCookie(c)
|
||||||
|
}
|
||||||
err = ss.Clear(response, request)
|
err = ss.Clear(response, request)
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
|
|
||||||
// The following should only be for server stores
|
// The following should only be for server stores
|
||||||
loadReq := httptest.NewRequest("GET", "http://example.com/", nil)
|
loadReq := httptest.NewRequest("GET", "http://example.com/", nil)
|
||||||
loadReq.AddCookie(resultCookie)
|
for _, c := range resultCookies {
|
||||||
|
loadReq.AddCookie(c)
|
||||||
|
}
|
||||||
loadedAfterClear, err = ss.Load(loadReq)
|
loadedAfterClear, err = ss.Load(loadReq)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user