0
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-30 21:06:08 +01:00
gitea/tests
wxiaoguang ee242a08e9
Refactor issue template parsing and fix API endpoint (#29069)
The old code `GetTemplatesFromDefaultBranch(...) ([]*api.IssueTemplate,
map[string]error)` doesn't really follow Golang's habits, then the
second returned value might be misused. For example, the API function
`GetIssueTemplates` incorrectly checked the second returned value and
always responds 500 error.

This PR refactors GetTemplatesFromDefaultBranch to
ParseTemplatesFromDefaultBranch and clarifies its behavior, and fixes the
API endpoint bug, and adds some tests.

And by the way, add proper prefix `X-` for the header generated in
`checkDeprecatedAuthMethods`, because non-standard HTTP headers should
have `X-` prefix, and it is also consistent with the new code in
`GetIssueTemplates`
2024-02-12 05:04:10 +00:00
..
e2e
fuzz Rework markup link rendering (#26745) 2024-01-15 08:49:24 +00:00
gitea-lfs-meta
gitea-repositories-meta tests: missing refs/ in bare repositories (#28844) 2024-01-19 15:12:21 +08:00
integration Refactor issue template parsing and fix API endpoint (#29069) 2024-02-12 05:04:10 +00:00
testdata/data/attachments/a/0
mssql.ini.tmpl Disable query token param in integration tests (#28592) 2023-12-23 11:29:51 +08:00
mysql.ini.tmpl Disable query token param in integration tests (#28592) 2023-12-23 11:29:51 +08:00
pgsql.ini.tmpl Disable query token param in integration tests (#28592) 2023-12-23 11:29:51 +08:00
sqlite.ini.tmpl Disable query token param in integration tests (#28592) 2023-12-23 11:29:51 +08:00
test_utils.go