mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-04-21 15:26:42 +02:00
Dateien nach „tests/integration“ hochladen
This commit is contained in:
parent
ded3137441
commit
43cde371d2
1 changed files with 39 additions and 0 deletions
39
tests/integration/landingpagedetails_test.go
Normal file
39
tests/integration/landingpagedetails_test.go
Normal file
|
@ -0,0 +1,39 @@
|
|||
package integration
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/test"
|
||||
"code.gitea.io/gitea/tests"
|
||||
)
|
||||
|
||||
func TestLandingPageDetailsDefault(t *testing.T) {
|
||||
defer tests.PrepareTestEnv(t)()
|
||||
|
||||
req := NewRequest(t, "GET", "/")
|
||||
resp := MakeRequest(t, req, http.StatusOK)
|
||||
htmlDoc := NewHTMLParser(t, resp.Body)
|
||||
htmlDoc.AssertElement(t, "a[href='https://forgejo.org/download/#installation-from-binary']", true)
|
||||
}
|
||||
|
||||
func TestLandingPageDetailsTrue(t *testing.T) {
|
||||
defer tests.PrepareTestEnv(t)()
|
||||
defer test.MockVariableValue(&setting.LandingPageDetails, true)()
|
||||
|
||||
req := NewRequest(t, "GET", "/")
|
||||
resp := MakeRequest(t, req, http.StatusOK)
|
||||
htmlDoc := NewHTMLParser(t, resp.Body)
|
||||
htmlDoc.AssertElement(t, "a[href='https://forgejo.org/download/#installation-from-binary']", true)
|
||||
}
|
||||
|
||||
func TestLandingPageDetailsFalse(t *testing.T) {
|
||||
defer tests.PrepareTestEnv(t)()
|
||||
defer test.MockVariableValue(&setting.LandingPageDetails, false)()
|
||||
|
||||
req := NewRequest(t, "GET", "/")
|
||||
resp := MakeRequest(t, req, http.StatusOK)
|
||||
htmlDoc := NewHTMLParser(t, resp.Body)
|
||||
htmlDoc.AssertElement(t, "a[href='https://forgejo.org/download/#installation-from-binary']", false)
|
||||
}
|
Loading…
Add table
Reference in a new issue