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/action_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/action_test.go')
-rw-r--r-- | models/action_test.go | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/models/action_test.go b/models/action_test.go index 5eb89aac21..e7766eac2f 100644 --- a/models/action_test.go +++ b/models/action_test.go @@ -332,54 +332,6 @@ func TestUpdateIssuesCommit_AnotherRepoNoPermission(t *testing.T) { CheckConsistencyFor(t, &Action{}) } -func TestTransferRepoAction(t *testing.T) { - assert.NoError(t, PrepareTestDatabase()) - - user2 := AssertExistsAndLoadBean(t, &User{ID: 2}).(*User) - user4 := AssertExistsAndLoadBean(t, &User{ID: 4}).(*User) - repo := AssertExistsAndLoadBean(t, &Repository{ID: 1, OwnerID: user2.ID}).(*Repository) - - repo.OwnerID = user4.ID - repo.Owner = user4 - - actionBean := &Action{ - OpType: ActionTransferRepo, - ActUserID: user2.ID, - ActUser: user2, - RepoID: repo.ID, - Repo: repo, - IsPrivate: repo.IsPrivate, - } - AssertNotExistsBean(t, actionBean) - assert.NoError(t, TransferRepoAction(user2, user2, repo)) - AssertExistsAndLoadBean(t, actionBean) - - _, err := x.ID(repo.ID).Cols("owner_id").Update(repo) - assert.NoError(t, err) - CheckConsistencyFor(t, &Action{}) -} - -func TestMergePullRequestAction(t *testing.T) { - assert.NoError(t, PrepareTestDatabase()) - user := AssertExistsAndLoadBean(t, &User{ID: 2}).(*User) - repo := AssertExistsAndLoadBean(t, &Repository{ID: 1, OwnerID: user.ID}).(*Repository) - repo.Owner = user - issue := AssertExistsAndLoadBean(t, &Issue{ID: 3, RepoID: repo.ID}).(*Issue) - - actionBean := &Action{ - OpType: ActionMergePullRequest, - ActUserID: user.ID, - ActUser: user, - RepoID: repo.ID, - Repo: repo, - IsPrivate: repo.IsPrivate, - } - AssertNotExistsBean(t, actionBean) - assert.NoError(t, MergePullRequestAction(user, repo, issue)) - AssertExistsAndLoadBean(t, actionBean) - CheckConsistencyFor(t, &Action{}) -} - func TestGetFeeds(t *testing.T) { // test with an individual user assert.NoError(t, PrepareTestDatabase()) |