summaryrefslogtreecommitdiffstats
path: root/tests/integration
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-10-01 18:41:52 +0800
committerGitHub <noreply@github.com>2023-10-01 10:41:52 +0000
commit6e87a44034af3cfef1ceed3d653b3851ec2c1118 (patch)
treed79eec833680fd7aaef8bda3b143f6486d14cc22 /tests/integration
parent6b65c41ebff6a59a266247bdbbce3d012cd05ffd (diff)
downloadgitea-6e87a44034af3cfef1ceed3d653b3851ec2c1118.tar.gz
gitea-6e87a44034af3cfef1ceed3d653b3851ec2c1118.zip
Allow get release download files and lfs files with oauth2 token format (#26430)
Fix #26165 Fix #25257
Diffstat (limited to 'tests/integration')
-rw-r--r--tests/integration/release_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/integration/release_test.go b/tests/integration/release_test.go
index 8de761ea6c..42d0d00e78 100644
--- a/tests/integration/release_test.go
+++ b/tests/integration/release_test.go
@@ -239,3 +239,20 @@ func TestViewTagsList(t *testing.T) {
assert.EqualValues(t, []string{"v1.0", "delete-tag", "v1.1"}, tagNames)
}
+
+func TestDownloadReleaseAttachment(t *testing.T) {
+ defer tests.PrepareTestEnv(t)()
+
+ tests.PrepareAttachmentsStorage(t)
+
+ repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 2})
+
+ url := repo.Link() + "/releases/download/v1.1/README.md"
+
+ req := NewRequest(t, "GET", url)
+ MakeRequest(t, req, http.StatusNotFound)
+
+ req = NewRequest(t, "GET", url)
+ session := loginUser(t, "user2")
+ session.MakeRequest(t, req, http.StatusOK)
+}