diff options
author | David Schneiderbauer <daviian@users.noreply.github.com> | 2018-06-15 05:42:46 +0200 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2018-06-15 11:42:46 +0800 |
commit | adba2ad609ca3f1612463a4ac6af22fd30b9e75f (patch) | |
tree | 8290255dcae15d54ada4c8d16c9209adb09e3ddf /integrations | |
parent | 6efdcaed86565c91a3dc77631372a9cc45a58e89 (diff) | |
download | gitea-adba2ad609ca3f1612463a4ac6af22fd30b9e75f.tar.gz gitea-adba2ad609ca3f1612463a4ac6af22fd30b9e75f.zip |
fix not respecting landing page setting (#4209)
* fix not respecting landing page setting
* fmt
* add landing page test
Diffstat (limited to 'integrations')
-rw-r--r-- | integrations/setting_test.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/integrations/setting_test.go b/integrations/setting_test.go index a8d1f01e8f..2aac8e90ed 100644 --- a/integrations/setting_test.go +++ b/integrations/setting_test.go @@ -68,3 +68,25 @@ func TestSettingShowUserEmailProfile(t *testing.T) { setting.UI.ShowUserEmail = showUserEmail } + +func TestSettingLandingPage(t *testing.T) { + prepareTestEnv(t) + + landingPage := setting.LandingPageURL + + setting.LandingPageURL = setting.LandingPageHome + req := NewRequest(t, "GET", "/") + MakeRequest(t, req, http.StatusOK) + + setting.LandingPageURL = setting.LandingPageExplore + req = NewRequest(t, "GET", "/") + resp := MakeRequest(t, req, http.StatusFound) + assert.Equal(t, "/explore", resp.Header().Get("Location")) + + setting.LandingPageURL = setting.LandingPageOrganizations + req = NewRequest(t, "GET", "/") + resp = MakeRequest(t, req, http.StatusFound) + assert.Equal(t, "/explore/organizations", resp.Header().Get("Location")) + + setting.LandingPageURL = landingPage +} |