aboutsummaryrefslogtreecommitdiffstats
path: root/integrations
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2021-06-18 16:46:22 +0200
committerGitHub <noreply@github.com>2021-06-18 16:46:22 +0200
commitd5be9ddc97243857ee26867a2f18bfdae627a1cf (patch)
treec52a43d18064541cf04f8329b4a90996e9d8ce06 /integrations
parentd8792ebcefcb30981642cae459641a9351ae2dfa (diff)
downloadgitea-d5be9ddc97243857ee26867a2f18bfdae627a1cf.tar.gz
gitea-d5be9ddc97243857ee26867a2f18bfdae627a1cf.zip
fix TestAPIRepoTransfer (#16189)
Diffstat (limited to 'integrations')
-rw-r--r--integrations/api_repo_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/integrations/api_repo_test.go b/integrations/api_repo_test.go
index 2c68d38846..7052e74b01 100644
--- a/integrations/api_repo_test.go
+++ b/integrations/api_repo_test.go
@@ -466,7 +466,7 @@ func TestAPIRepoTransfer(t *testing.T) {
session := loginUser(t, user.Name)
token := getTokenForLoggedInUser(t, session)
repoName := "moveME"
- repo := new(models.Repository)
+ apiRepo := new(api.Repository)
req := NewRequestWithJSON(t, "POST", fmt.Sprintf("/api/v1/user/repos?token=%s", token), &api.CreateRepoOption{
Name: repoName,
Description: "repo move around",
@@ -475,12 +475,12 @@ func TestAPIRepoTransfer(t *testing.T) {
AutoInit: true,
})
resp := session.MakeRequest(t, req, http.StatusCreated)
- DecodeJSON(t, resp, repo)
+ DecodeJSON(t, resp, apiRepo)
//start testing
for _, testCase := range testCases {
user = models.AssertExistsAndLoadBean(t, &models.User{ID: testCase.ctxUserID}).(*models.User)
- repo = models.AssertExistsAndLoadBean(t, &models.Repository{ID: repo.ID}).(*models.Repository)
+ repo := models.AssertExistsAndLoadBean(t, &models.Repository{ID: apiRepo.ID}).(*models.Repository)
session = loginUser(t, user.Name)
token = getTokenForLoggedInUser(t, session)
req = NewRequestWithJSON(t, "POST", fmt.Sprintf("/api/v1/repos/%s/%s/transfer?token=%s", repo.OwnerName, repo.Name, token), &api.TransferRepoOption{
@@ -491,7 +491,7 @@ func TestAPIRepoTransfer(t *testing.T) {
}
//cleanup
- repo = models.AssertExistsAndLoadBean(t, &models.Repository{ID: repo.ID}).(*models.Repository)
+ repo := models.AssertExistsAndLoadBean(t, &models.Repository{ID: apiRepo.ID}).(*models.Repository)
_ = models.DeleteRepository(user, repo.OwnerID, repo.ID)
}