1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-04 08:17:24 -05:00
This commit is contained in:
Lunny Xiao 2024-10-26 00:09:47 -07:00
parent 3230afdf6a
commit 09c7c906e9
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A

View File

@ -197,13 +197,13 @@ func TestAPIGetContentsRefFormats(t *testing.T) {
resp = MakeRequest(t, NewRequest(t, http.MethodGet, fileWith40c), http.StatusOK)
raw, err = io.ReadAll(resp.Body)
assert.NoError(t, err)
assert.EqualValues(t, "# test\n", string(raw))
assert.EqualValues(t, "# a_file_path_with_40_characters_for_tests\n", string(raw))
// Test with a filepath with 40 characters and name is a commit SHA
fileWith40c = setting.AppURL + "api/v1/repos/user13/repo11/raw/" + "65f1bf27bc3bf70f64657658635e66094edbcb4d"
resp = MakeRequest(t, NewRequest(t, http.MethodGet, fileWith40c), http.StatusOK)
raw, err = io.ReadAll(resp.Body)
assert.NoError(t, err)
assert.EqualValues(t, "# 65f1bf27bc3bf70f64657658635e66094edbcb4d\n", string(raw))
assert.EqualValues(t, "# test\n", string(raw))
})
}