forked from go-gitea/gitea
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow colon between fixing word and issue (go-gitea#7207)
* Allow colon between fixing word and issue * update test
- Loading branch information
1 parent
9ce4d89
commit 94ceaf1
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -166,6 +166,7 @@ func Test_getIssueFromRef(t *testing.T) { | |
{"reopen #2", 2}, | ||
{"user2/repo2#1", 4}, | ||
{"fixes user2/repo2#1", 4}, | ||
{"fixes: user2/repo2#1", 4}, | ||
} { | ||
issue, err := getIssueFromRef(repo, test.Ref) | ||
assert.NoError(t, err) | ||
|
@@ -260,6 +261,31 @@ func TestUpdateIssuesCommit(t *testing.T) { | |
CheckConsistencyFor(t, &Action{}) | ||
} | ||
|
||
func TestUpdateIssuesCommit_Colon(t *testing.T) { | ||
assert.NoError(t, PrepareTestDatabase()) | ||
pushCommits := []*PushCommit{ | ||
{ | ||
Sha1: "abcdef2", | ||
CommitterEmail: "[email protected]", | ||
CommitterName: "User Two", | ||
AuthorEmail: "[email protected]", | ||
AuthorName: "User Two", | ||
Message: "close: #2", | ||
}, | ||
} | ||
|
||
user := AssertExistsAndLoadBean(t, &User{ID: 2}).(*User) | ||
repo := AssertExistsAndLoadBean(t, &Repository{ID: 1}).(*Repository) | ||
repo.Owner = user | ||
|
||
issueBean := &Issue{RepoID: repo.ID, Index: 2} | ||
|
||
AssertNotExistsBean(t, &Issue{RepoID: repo.ID, Index: 2}, "is_closed=1") | ||
assert.NoError(t, UpdateIssuesCommit(user, repo, pushCommits, repo.DefaultBranch)) | ||
AssertExistsAndLoadBean(t, issueBean, "is_closed=1") | ||
CheckConsistencyFor(t, &Action{}) | ||
} | ||
|
||
func TestUpdateIssuesCommit_Issue5957(t *testing.T) { | ||
assert.NoError(t, PrepareTestDatabase()) | ||
user := AssertExistsAndLoadBean(t, &User{ID: 2}).(*User) | ||
|