diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-05-29 23:00:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-29 15:00:21 +0000 |
commit | ca5f3028763f82dfe2491d3e408afbc369ec2a73 (patch) | |
tree | a69d1f87de57b7e92d017ed88d22b595094f5325 /modules | |
parent | 73b57c29922a9f76ca061dfe7c118b6e923ee606 (diff) | |
download | gitea-ca5f3028763f82dfe2491d3e408afbc369ec2a73.tar.gz gitea-ca5f3028763f82dfe2491d3e408afbc369ec2a73.zip |
Fix admin config page error, use tests to cover the admin config and 500 error page (#24965)
The admin config page has been broken for many many times, a little
refactoring would make this page panic.
So, add a test for it, and add another test to cover the 500 error page.
Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/test/utils.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/test/utils.go b/modules/test/utils.go index 7686d3f289..282895eaa9 100644 --- a/modules/test/utils.go +++ b/modules/test/utils.go @@ -5,9 +5,14 @@ package test import ( "net/http" + "strings" ) // RedirectURL returns the redirect URL of a http response. func RedirectURL(resp http.ResponseWriter) string { return resp.Header().Get("Location") } + +func IsNormalPageCompleted(s string) bool { + return strings.Contains(s, `<footer class="page-footer"`) && strings.Contains(s, `</html>`) +} |