summaryrefslogtreecommitdiffstats
path: root/models/repo_test.go
diff options
context:
space:
mode:
authorEthan Koenig <ethantkoenig@gmail.com>2017-09-03 01:20:24 -0700
committerLauris BH <lauris@nix.lv>2017-09-03 11:20:24 +0300
commitb689bb61804fddfd2df8df7250522b0fc227484e (patch)
tree6cd96dfc3c0c7b2a0b265217f2893aa606307b0a /models/repo_test.go
parent79f7839633167bbb146a7b0d17ce0ec1c990d085 (diff)
downloadgitea-b689bb61804fddfd2df8df7250522b0fc227484e.tar.gz
gitea-b689bb61804fddfd2df8df7250522b0fc227484e.zip
Webhooks for repo creation/deletion (#1663)
* Webhooks for repo creation/deletion * add createHookTask * Add handles for GetSlackPayload and GetDiscordPayload
Diffstat (limited to 'models/repo_test.go')
-rw-r--r--models/repo_test.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/models/repo_test.go b/models/repo_test.go
index 4b6fd440aa..c1eb4e2a79 100644
--- a/models/repo_test.go
+++ b/models/repo_test.go
@@ -118,13 +118,12 @@ func TestGetUserFork(t *testing.T) {
func TestForkRepository(t *testing.T) {
assert.NoError(t, PrepareTestDatabase())
- // User13 has repo 11 forked from repo10
- repo, err := GetRepositoryByID(10)
- assert.NoError(t, err)
- assert.NotNil(t, repo)
+ // user 13 has already forked repo10
+ user := AssertExistsAndLoadBean(t, &User{ID: 13}).(*User)
+ repo := AssertExistsAndLoadBean(t, &Repository{ID: 10}).(*Repository)
- repo, err = ForkRepository(&User{ID: 13}, repo, "test", "test")
- assert.Nil(t, repo)
+ fork, err := ForkRepository(user, user, repo, "test", "test")
+ assert.Nil(t, fork)
assert.Error(t, err)
assert.True(t, IsErrRepoAlreadyExist(err))
}