You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

signout_test.go 510B

123456789101112131415161718192021222324
  1. // Copyright 2017 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package integration
  4. import (
  5. "net/http"
  6. "testing"
  7. "code.gitea.io/gitea/tests"
  8. )
  9. func TestSignOut(t *testing.T) {
  10. defer tests.PrepareTestEnv(t)()
  11. session := loginUser(t, "user2")
  12. req := NewRequest(t, "POST", "/user/logout")
  13. session.MakeRequest(t, req, http.StatusOK)
  14. // try to view a private repo, should fail
  15. req = NewRequest(t, "GET", "/user2/repo2")
  16. session.MakeRequest(t, req, http.StatusNotFound)
  17. }