code.gitea.io/gitea@v1.22.3/tests/integration/signout_test.go (about)

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