Skip to content

Commit 06df2c9

Browse files
committed
add landing page test
1 parent c7ca3e2 commit 06df2c9

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

integrations/setting_test.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,25 @@ func TestSettingShowUserEmailProfile(t *testing.T) {
6868

6969
setting.UI.ShowUserEmail = showUserEmail
7070
}
71+
72+
func TestSettingLandingPage(t *testing.T) {
73+
prepareTestEnv(t)
74+
75+
landingPage := setting.LandingPageURL
76+
77+
setting.LandingPageURL = setting.LandingPageHome
78+
req := NewRequest(t, "GET", "/")
79+
MakeRequest(t, req, http.StatusOK)
80+
81+
setting.LandingPageURL = setting.LandingPageExplore
82+
req = NewRequest(t, "GET", "/")
83+
resp := MakeRequest(t, req, http.StatusFound)
84+
assert.Equal(t, "/explore", resp.Header().Get("Location"))
85+
86+
setting.LandingPageURL = setting.LandingPageOrganizations
87+
req = NewRequest(t, "GET", "/")
88+
resp = MakeRequest(t, req, http.StatusFound)
89+
assert.Equal(t, "/explore/organizations", resp.Header().Get("Location"))
90+
91+
setting.LandingPageURL = landingPage
92+
}

0 commit comments

Comments
 (0)