aboutsummaryrefslogtreecommitdiffstats
path: root/tests/integration/mirror_push_test.go
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-04-14 03:45:33 +0800
committerGitHub <noreply@github.com>2023-04-13 15:45:33 -0400
commit5b9557aef59b190c55de9ea218bf51152bc04786 (patch)
treed77004c983875886a00acd1561a74b8c3d5ce682 /tests/integration/mirror_push_test.go
parentb7221bec34fd49495234a18c26e4f5d81483e102 (diff)
downloadgitea-5b9557aef59b190c55de9ea218bf51152bc04786.tar.gz
gitea-5b9557aef59b190c55de9ea218bf51152bc04786.zip
Refactor cookie (#24107)
Close #24062 At the beginning, I just wanted to fix the warning mentioned by #24062 But, the cookie code really doesn't look good to me, so clean up them. Complete the TODO on `SetCookie`: > TODO: Copied from gitea.com/macaron/macaron and should be improved after macaron removed.
Diffstat (limited to 'tests/integration/mirror_push_test.go')
-rw-r--r--tests/integration/mirror_push_test.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/integration/mirror_push_test.go b/tests/integration/mirror_push_test.go
index b2ec6c0932..9abae63b0a 100644
--- a/tests/integration/mirror_push_test.go
+++ b/tests/integration/mirror_push_test.go
@@ -15,6 +15,7 @@ import (
repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/models/unittest"
user_model "code.gitea.io/gitea/models/user"
+ gitea_context "code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/repository"
"code.gitea.io/gitea/modules/setting"
@@ -91,7 +92,7 @@ func doCreatePushMirror(ctx APITestContext, address, username, password string)
})
ctx.Session.MakeRequest(t, req, http.StatusSeeOther)
- flashCookie := ctx.Session.GetCookie("macaron_flash")
+ flashCookie := ctx.Session.GetCookie(gitea_context.CookieNameFlash)
assert.NotNil(t, flashCookie)
assert.Contains(t, flashCookie.Value, "success")
}
@@ -112,7 +113,7 @@ func doRemovePushMirror(ctx APITestContext, address, username, password string,
})
ctx.Session.MakeRequest(t, req, http.StatusSeeOther)
- flashCookie := ctx.Session.GetCookie("macaron_flash")
+ flashCookie := ctx.Session.GetCookie(gitea_context.CookieNameFlash)
assert.NotNil(t, flashCookie)
assert.Contains(t, flashCookie.Value, "success")
}