diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-11-15 16:06:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-15 16:06:11 +0800 |
commit | 21ae9838e04233bbf9930d368d935fd1f9b68c34 (patch) | |
tree | 610abb6f1ec2df235d469276b36f6d26e00e4653 /models/repo_test.go | |
parent | b30d744e0986dcf716d4f57dac8c72a494bb226b (diff) | |
download | gitea-21ae9838e04233bbf9930d368d935fd1f9b68c34.tar.gz gitea-21ae9838e04233bbf9930d368d935fd1f9b68c34.zip |
Move transfer repository and rename repository on a service package and start action notification (#8573)
* move transfer repository and rename repository on a service package and start action notification
* remove unused codes
* fix lint
* fix bugs
* fix test
* fix test
* fix test
* fix lint
* update go mod and sum
Diffstat (limited to 'models/repo_test.go')
-rw-r--r-- | models/repo_test.go | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/models/repo_test.go b/models/repo_test.go index bf10de8d99..72a2959eb7 100644 --- a/models/repo_test.go +++ b/models/repo_test.go @@ -15,7 +15,6 @@ import ( "code.gitea.io/gitea/modules/markup" "github.com/stretchr/testify/assert" - "github.com/unknwon/com" ) func TestRepo(t *testing.T) { @@ -142,29 +141,6 @@ func TestRepoAPIURL(t *testing.T) { assert.Equal(t, "https://try.gitea.io/api/v1/repos/user12/repo10", repo.APIURL()) } -func TestTransferOwnership(t *testing.T) { - assert.NoError(t, PrepareTestDatabase()) - - doer := AssertExistsAndLoadBean(t, &User{ID: 2}).(*User) - repo := AssertExistsAndLoadBean(t, &Repository{ID: 3}).(*Repository) - repo.Owner = AssertExistsAndLoadBean(t, &User{ID: repo.OwnerID}).(*User) - assert.NoError(t, TransferOwnership(doer, "user2", repo)) - - transferredRepo := AssertExistsAndLoadBean(t, &Repository{ID: 3}).(*Repository) - assert.EqualValues(t, 2, transferredRepo.OwnerID) - - assert.False(t, com.IsExist(RepoPath("user3", "repo3"))) - assert.True(t, com.IsExist(RepoPath("user2", "repo3"))) - AssertExistsAndLoadBean(t, &Action{ - OpType: ActionTransferRepo, - ActUserID: 2, - RepoID: 3, - Content: "user3/repo3", - }) - - CheckConsistencyFor(t, &Repository{}, &User{}, &Team{}) -} - func TestUploadAvatar(t *testing.T) { // Generate image |