@@ -110,6 +110,33 @@ var _ = Describe("NewSessionStore", func() {
110110
111111 CheckCookieOptions()
112112 })
113+
114+ Context("when LoadSession is called", func() {
115+ var loadedSession *sessionsapi.SessionState
116+ BeforeEach(func() {
117+ req := httptest.NewRequest("GET", "http://example.com/", nil)
118+ resp := httptest.NewRecorder()
119+ err := ss.SaveSession(resp, req, session)
120+ Expect(err).ToNot(HaveOccurred())
121+
122+ for _, cookie := range resp.Result().Cookies() {
123+ request.AddCookie(cookie)
124+ }
125+ loadedSession, err = ss.LoadSession(request)
126+ Expect(err).ToNot(HaveOccurred())
127+ })
128+
129+ It("loads a session equal to the original session", func() {
130+ if cookieOpts.CookieSecret == "" {
131+ // Only Email and User stored in session when encrypted
132+ Expect(loadedSession.Email).To(Equal(session.Email))
133+ Expect(loadedSession.User).To(Equal(session.User))
134+ } else {
135+ // All fields stored in session if encrypted
136+ Expect(loadedSession).To(Equal(session))
137+ }
138+ })
139+ })
113140 }
114141
115142 RunCookieTests := func() {
@@ -141,7 +168,6 @@ var _ = Describe("NewSessionStore", func() {
141168 })
142169
143170 SessionStoreInterfaceTests()
144−
145171 })
146172 }
147173