mirror of https://github.com/go-gitea/gitea
Git with a cup of tea, painless self-hosted git service
Mirror for internal git.with.parts use
https://git.with.parts
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
878 B
29 lines
878 B
8 years ago
|
// Copyright 2017 The Gitea Authors. All rights reserved.
|
||
2 years ago
|
// SPDX-License-Identifier: MIT
|
||
8 years ago
|
|
||
1 year ago
|
package repository
|
||
8 years ago
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
3 years ago
|
"code.gitea.io/gitea/models/db"
|
||
3 years ago
|
repo_model "code.gitea.io/gitea/models/repo"
|
||
3 years ago
|
"code.gitea.io/gitea/models/unittest"
|
||
3 years ago
|
|
||
8 years ago
|
"github.com/stretchr/testify/assert"
|
||
|
)
|
||
|
|
||
|
func TestRepository_DeleteCollaboration(t *testing.T) {
|
||
3 years ago
|
assert.NoError(t, unittest.PrepareTestDatabase())
|
||
8 years ago
|
|
||
2 years ago
|
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 4})
|
||
2 years ago
|
assert.NoError(t, repo.LoadOwner(db.DefaultContext))
|
||
3 years ago
|
assert.NoError(t, DeleteCollaboration(repo, 4))
|
||
3 years ago
|
unittest.AssertNotExistsBean(t, &repo_model.Collaboration{RepoID: repo.ID, UserID: 4})
|
||
8 years ago
|
|
||
3 years ago
|
assert.NoError(t, DeleteCollaboration(repo, 4))
|
||
3 years ago
|
unittest.AssertNotExistsBean(t, &repo_model.Collaboration{RepoID: repo.ID, UserID: 4})
|
||
8 years ago
|
|
||
3 years ago
|
unittest.CheckConsistencyFor(t, &repo_model.Repository{ID: repo.ID})
|
||
8 years ago
|
}
|