summaryrefslogtreecommitdiffstats
path: root/models/update_test.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2017-02-25 22:54:40 +0800
committerGitHub <noreply@github.com>2017-02-25 22:54:40 +0800
commitcd1821a7e292b05e04fcc2a969b42d06ab512849 (patch)
tree084f97bfb24a37ec3028d15fdacb51e86cfcc368 /models/update_test.go
parente8e56da9ac321aacb3c06968997a45c2f133cd4e (diff)
downloadgitea-cd1821a7e292b05e04fcc2a969b42d06ab512849.tar.gz
gitea-cd1821a7e292b05e04fcc2a969b42d06ab512849.zip
Move push update to post-receive and protected branch check to pre-receive (#1030)
* move all push update to git hook post-receive and protected branch check to git hook pre-receive * add SSH_ORIGINAL_COMMAND check back * remove all unused codes * fix the import
Diffstat (limited to 'models/update_test.go')
-rw-r--r--models/update_test.go34
1 files changed, 0 insertions, 34 deletions
diff --git a/models/update_test.go b/models/update_test.go
index db9d7b94b9..ae95a9641b 100644
--- a/models/update_test.go
+++ b/models/update_test.go
@@ -14,40 +14,6 @@ import (
"github.com/stretchr/testify/assert"
)
-func TestAddUpdateTask(t *testing.T) {
- assert.NoError(t, PrepareTestDatabase())
- task := &UpdateTask{
- UUID: "uuid4",
- RefName: "refName4",
- OldCommitID: "oldCommitId4",
- NewCommitID: "newCommitId4",
- }
- assert.NoError(t, AddUpdateTask(task))
- AssertExistsAndLoadBean(t, task)
-}
-
-func TestGetUpdateTaskByUUID(t *testing.T) {
- assert.NoError(t, PrepareTestDatabase())
- task, err := GetUpdateTaskByUUID("uuid1")
- assert.NoError(t, err)
- assert.Equal(t, "uuid1", task.UUID)
- assert.Equal(t, "refName1", task.RefName)
- assert.Equal(t, "oldCommitId1", task.OldCommitID)
- assert.Equal(t, "newCommitId1", task.NewCommitID)
-
- _, err = GetUpdateTaskByUUID("invalid")
- assert.Error(t, err)
- assert.True(t, IsErrUpdateTaskNotExist(err))
-}
-
-func TestDeleteUpdateTaskByUUID(t *testing.T) {
- assert.NoError(t, PrepareTestDatabase())
- assert.NoError(t, DeleteUpdateTaskByUUID("uuid1"))
- AssertNotExistsBean(t, &UpdateTask{UUID: "uuid1"})
-
- assert.NoError(t, DeleteUpdateTaskByUUID("invalid"))
-}
-
func TestCommitToPushCommit(t *testing.T) {
now := time.Now()
sig := &git.Signature{