From 6d0898aaae4232b445a099f6e4c9658684bf5387 Mon Sep 17 00:00:00 2001 From: motoki317 Date: Sat, 29 Apr 2023 22:08:36 +0900 Subject: [PATCH] fix logout test --- internal/server_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/server_test.go b/internal/server_test.go index f4c94fcf..9403512b 100644 --- a/internal/server_test.go +++ b/internal/server_test.go @@ -304,7 +304,7 @@ func TestServerLogout(t *testing.T) { req := newDefaultHttpRequest("/_oauth/logout") res, _ := doHttpRequest(req, nil) - require.Equal(401, res.StatusCode, "should return a 401") + require.Equal(307, res.StatusCode, "should return a 307") // Check for cookie var cookie *http.Cookie @@ -317,8 +317,7 @@ func TestServerLogout(t *testing.T) { require.Less(cookie.Expires.Local().Unix(), time.Now().Local().Unix()-50, "cookie should have expired") // Test with redirect - config.LogoutRedirect = "http://example.com/path" - req = newDefaultHttpRequest("/_oauth/logout") + req = newDefaultHttpRequest("/_oauth/logout?redirect=/path") res, _ = doHttpRequest(req, nil) require.Equal(307, res.StatusCode, "should return a 307")