diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2022-06-05 03:18:50 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-04 20:18:50 +0100 |
commit | 12c742f8dc25e4148c44d1265d119c35f161bf74 (patch) | |
tree | 0c35f1de4cf7bdea1dfc8b03468f3616d0c82796 /integrations | |
parent | 449ea6005fb613212102126ff267f5c16f7c40b8 (diff) | |
download | gitea-12c742f8dc25e4148c44d1265d119c35f161bf74.tar.gz gitea-12c742f8dc25e4148c44d1265d119c35f161bf74.zip |
Fix order by parameter (#19849)
Upgrade builder to v0.3.11
Upgrade xorm to v1.3.1 and fixed some hidden bugs.
Replace #19821
Replace #19834
Included #19850
Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'integrations')
-rw-r--r-- | integrations/api_admin_test.go | 1 | ||||
-rw-r--r-- | integrations/api_keys_test.go | 12 | ||||
-rw-r--r-- | integrations/api_releases_test.go | 14 | ||||
-rw-r--r-- | integrations/api_repo_test.go | 5 |
4 files changed, 20 insertions, 12 deletions
diff --git a/integrations/api_admin_test.go b/integrations/api_admin_test.go index b935d3eac5..62c7d7eaf7 100644 --- a/integrations/api_admin_test.go +++ b/integrations/api_admin_test.go @@ -37,7 +37,6 @@ func TestAPIAdminCreateAndDeleteSSHKey(t *testing.T) { unittest.AssertExistsAndLoadBean(t, &asymkey_model.PublicKey{ ID: newPublicKey.ID, Name: newPublicKey.Title, - Content: newPublicKey.Key, Fingerprint: newPublicKey.Fingerprint, OwnerID: keyOwner.ID, }) diff --git a/integrations/api_keys_test.go b/integrations/api_keys_test.go index b1f455d932..198da29b8a 100644 --- a/integrations/api_keys_test.go +++ b/integrations/api_keys_test.go @@ -116,12 +116,14 @@ func TestCreateUserKey(t *testing.T) { var newPublicKey api.PublicKey DecodeJSON(t, resp, &newPublicKey) + fingerprint, err := asymkey_model.CalcFingerprint(rawKeyBody.Key) + assert.NoError(t, err) unittest.AssertExistsAndLoadBean(t, &asymkey_model.PublicKey{ - ID: newPublicKey.ID, - OwnerID: user.ID, - Name: rawKeyBody.Title, - Content: rawKeyBody.Key, - Mode: perm.AccessModeWrite, + ID: newPublicKey.ID, + OwnerID: user.ID, + Name: rawKeyBody.Title, + Fingerprint: fingerprint, + Mode: perm.AccessModeWrite, }) // Search by fingerprint diff --git a/integrations/api_releases_test.go b/integrations/api_releases_test.go index ebb76cc163..74639e9007 100644 --- a/integrations/api_releases_test.go +++ b/integrations/api_releases_test.go @@ -84,12 +84,13 @@ func createNewReleaseUsingAPI(t *testing.T, session *TestSession, token string, var newRelease api.Release DecodeJSON(t, resp, &newRelease) - unittest.AssertExistsAndLoadBean(t, &models.Release{ + rel := &models.Release{ ID: newRelease.ID, TagName: newRelease.TagName, Title: newRelease.Title, - Note: newRelease.Note, - }) + } + unittest.AssertExistsAndLoadBean(t, rel) + assert.EqualValues(t, newRelease.Note, rel.Note) return &newRelease } @@ -137,12 +138,13 @@ func TestAPICreateAndUpdateRelease(t *testing.T) { resp = session.MakeRequest(t, req, http.StatusOK) DecodeJSON(t, resp, &newRelease) - unittest.AssertExistsAndLoadBean(t, &models.Release{ + rel := &models.Release{ ID: newRelease.ID, TagName: newRelease.TagName, Title: newRelease.Title, - Note: newRelease.Note, - }) + } + unittest.AssertExistsAndLoadBean(t, rel) + assert.EqualValues(t, rel.Note, newRelease.Note) } func TestAPICreateReleaseToDefaultBranch(t *testing.T) { diff --git a/integrations/api_repo_test.go b/integrations/api_repo_test.go index 8f08da16a1..57fe65f4bf 100644 --- a/integrations/api_repo_test.go +++ b/integrations/api_repo_test.go @@ -110,6 +110,11 @@ func TestAPISearchRepo(t *testing.T) { }, }, { + name: "RepositoriesByName", requestURL: fmt.Sprintf("/api/v1/repos/search?q=%s&private=false", "user2/big_test_"), expectedResults: expectedResults{ + user2: {count: 2, repoName: "big_test_"}, + }, + }, + { name: "RepositoriesAccessibleAndRelatedToUser", requestURL: fmt.Sprintf("/api/v1/repos/search?uid=%d", user.ID), expectedResults: expectedResults{ nil: {count: 5}, user: {count: 9, includesPrivate: true}, |