@@ -452,21 +452,38 @@ func SessionStoreInterfaceTests(in *testInput) {
452452 })
453453
454454 Context("when Load is called", func() {
455− BeforeEach(func() {
456− req := httptest.NewRequest("GET", "http://example.com/", nil)
457− resp := httptest.NewRecorder()
458− err := in.ss().Save(resp, req, in.session)
459− Expect(err).ToNot(HaveOccurred())
455+ Context("with a valid session cookie in the request", func() {
456+ BeforeEach(func() {
457+ req := httptest.NewRequest("GET", "http://example.com/", nil)
458+ resp := httptest.NewRecorder()
459+ err := in.ss().Save(resp, req, in.session)
460+ Expect(err).ToNot(HaveOccurred())
461+ for _, cookie := range resp.Result().Cookies() {
462+ in.request.AddCookie(cookie)
463+ }
464+ })
460465
461− for _, cookie := range resp.Result().Cookies() {
462− in.request.AddCookie(cookie)
463− }
466+ Context("before the refresh period", func() {
467+ LoadSessionTests(in)
468+ })
464469 })
465470
466− Context("before the refresh period", func() {
467− LoadSessionTests(in)
468− })
471+ Context("with no cookies in the request", func() {
472+ var loadedSession *sessionsapi.SessionState
473+ var loadErr error
474+
475+ BeforeEach(func() {
476+ loadedSession, loadErr = in.ss().Load(in.request)
477+ })
469478
479+ It("returns an empty session", func() {
480+ Expect(loadedSession).To(BeNil())
481+ })
482+
483+ It("should return a no cookie error", func() {
484+ Expect(loadErr).To(MatchError(http.ErrNoCookie))
485+ })
486+ })
470487 })
471488}
472489