mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-02 14:29:43 +00:00
Backport #38608 by @chlee1001 Users should know what they are doing, don't check everything, especially for that we don't understand. Fixes #23840 Co-authored-by: Chaehyeon Lee <chlee1001@naver.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -191,22 +191,3 @@ func TestSlackJSONPayload(t *testing.T) {
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "[<http://localhost:3000/test/repo|test/repo>:<http://localhost:3000/test/repo/src/branch/test|test>] 2 new commits pushed by user1", body.Text)
|
||||
}
|
||||
|
||||
func TestIsValidSlackChannel(t *testing.T) {
|
||||
tt := []struct {
|
||||
channelName string
|
||||
expected bool
|
||||
}{
|
||||
{"gitea", true},
|
||||
{"#gitea", true},
|
||||
{" ", false},
|
||||
{"#", false},
|
||||
{" #", false},
|
||||
{"gitea ", false},
|
||||
{" gitea", false},
|
||||
}
|
||||
|
||||
for _, v := range tt {
|
||||
assert.Equal(t, v.expected, IsValidSlackChannel(v.channelName))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user