diff options
Diffstat (limited to 'models/pull_test.go')
-rw-r--r-- | models/pull_test.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/models/pull_test.go b/models/pull_test.go index f5e9d486ff..2567984cc1 100644 --- a/models/pull_test.go +++ b/models/pull_test.go @@ -107,6 +107,18 @@ func TestGetUnmergedPullRequest(t *testing.T) { assert.True(t, IsErrPullRequestNotExist(err)) } +func TestHasUnmergedPullRequestsByHeadInfo(t *testing.T) { + assert.NoError(t, unittest.PrepareTestDatabase()) + + exist, err := HasUnmergedPullRequestsByHeadInfo(1, "branch2") + assert.NoError(t, err) + assert.Equal(t, true, exist) + + exist, err = HasUnmergedPullRequestsByHeadInfo(1, "not_exist_branch") + assert.NoError(t, err) + assert.Equal(t, false, exist) +} + func TestGetUnmergedPullRequestsByHeadInfo(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) prs, err := GetUnmergedPullRequestsByHeadInfo(1, "branch2") |