aboutsummaryrefslogtreecommitdiffstats
path: root/tests/integration/api_repo_lfs_locks_test.go
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2022-10-12 03:03:15 +0200
committerGitHub <noreply@github.com>2022-10-11 21:03:15 -0400
commit4dc3b2ec57cb8295a926a61c20cd0389ec1277c7 (patch)
treeaf5201e6e1fbcdc1874762c2f010dd146fad8a1b /tests/integration/api_repo_lfs_locks_test.go
parente026459a2d789d922185711218275c3daa25a4a7 (diff)
downloadgitea-4dc3b2ec57cb8295a926a61c20cd0389ec1277c7.tar.gz
gitea-4dc3b2ec57cb8295a926a61c20cd0389ec1277c7.zip
Use Name instead of DisplayName in LFS Lock (#21415)
Fixes #21268 Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'tests/integration/api_repo_lfs_locks_test.go')
-rw-r--r--tests/integration/api_repo_lfs_locks_test.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/integration/api_repo_lfs_locks_test.go b/tests/integration/api_repo_lfs_locks_test.go
index 0860f47533..2186933bd9 100644
--- a/tests/integration/api_repo_lfs_locks_test.go
+++ b/tests/integration/api_repo_lfs_locks_test.go
@@ -112,6 +112,7 @@ func TestAPILFSLocksLogged(t *testing.T) {
if len(test.addTime) > 0 {
var lfsLock api.LFSLockResponse
DecodeJSON(t, resp, &lfsLock)
+ assert.Equal(t, test.user.Name, lfsLock.Lock.Owner.Name)
assert.EqualValues(t, lfsLock.Lock.LockedAt.Format(time.RFC3339), lfsLock.Lock.LockedAt.Format(time.RFC3339Nano)) // locked at should be rounded to second
for _, id := range test.addTime {
resultsTests[id].locksTimes = append(resultsTests[id].locksTimes, time.Now())
@@ -129,7 +130,7 @@ func TestAPILFSLocksLogged(t *testing.T) {
DecodeJSON(t, resp, &lfsLocks)
assert.Len(t, lfsLocks.Locks, test.totalCount)
for i, lock := range lfsLocks.Locks {
- assert.EqualValues(t, test.locksOwners[i].DisplayName(), lock.Owner.Name)
+ assert.EqualValues(t, test.locksOwners[i].Name, lock.Owner.Name)
assert.WithinDuration(t, test.locksTimes[i], lock.LockedAt, 10*time.Second)
assert.EqualValues(t, lock.LockedAt.Format(time.RFC3339), lock.LockedAt.Format(time.RFC3339Nano)) // locked at should be rounded to second
}
@@ -143,7 +144,7 @@ func TestAPILFSLocksLogged(t *testing.T) {
assert.Len(t, lfsLocksVerify.Ours, test.oursCount)
assert.Len(t, lfsLocksVerify.Theirs, test.theirsCount)
for _, lock := range lfsLocksVerify.Ours {
- assert.EqualValues(t, test.user.DisplayName(), lock.Owner.Name)
+ assert.EqualValues(t, test.user.Name, lock.Owner.Name)
deleteTests = append(deleteTests, struct {
user *user_model.User
repo *repo_model.Repository
@@ -165,7 +166,7 @@ func TestAPILFSLocksLogged(t *testing.T) {
var lfsLockRep api.LFSLockResponse
DecodeJSON(t, resp, &lfsLockRep)
assert.Equal(t, test.lockID, lfsLockRep.Lock.ID)
- assert.Equal(t, test.user.DisplayName(), lfsLockRep.Lock.Owner.Name)
+ assert.Equal(t, test.user.Name, lfsLockRep.Lock.Owner.Name)
}
// check that we don't have any lock