diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2017-02-25 22:54:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-25 22:54:40 +0800 |
commit | cd1821a7e292b05e04fcc2a969b42d06ab512849 (patch) | |
tree | 084f97bfb24a37ec3028d15fdacb51e86cfcc368 /models/update_test.go | |
parent | e8e56da9ac321aacb3c06968997a45c2f133cd4e (diff) | |
download | gitea-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.go | 34 |
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{ |