From 5ee73d37c500b6a65007e9875f2483d580c54707 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 17 Aug 2017 22:36:02 +0800 Subject: [PATCH 1/2] add public links check --- integrations/links_test.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 integrations/links_test.go diff --git a/integrations/links_test.go b/integrations/links_test.go new file mode 100644 index 000000000000..7a7ba77342ac --- /dev/null +++ b/integrations/links_test.go @@ -0,0 +1,30 @@ +// Copyright 2017 The Gitea Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package integrations + +import ( + "net/http" + "testing" +) + +func TestLinksNoLogin(t *testing.T) { + prepareTestEnv(t) + + var links = []string{ + "/explore/repos", + "/explore/users", + "/explore/organizations", + "/", + "/user/sign_up", + "/user/login", + "/user/forgot_password", + "/swagger", + } + + for _, link := range links { + req := NewRequest(t, "GET", link) + MakeRequest(t, req, http.StatusOK) + } +} From d6760cf592c0e846ea8f0f74ad539bfc8964ef83 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 17 Aug 2017 22:42:24 +0800 Subject: [PATCH 2/2] more links for query parameters --- integrations/links_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/integrations/links_test.go b/integrations/links_test.go index 7a7ba77342ac..d40c9c24cfec 100644 --- a/integrations/links_test.go +++ b/integrations/links_test.go @@ -14,8 +14,11 @@ func TestLinksNoLogin(t *testing.T) { var links = []string{ "/explore/repos", + "/explore/repos?q=test&tab=", "/explore/users", + "/explore/users?q=test&tab=", "/explore/organizations", + "/explore/organizations?q=test&tab=", "/", "/user/sign_up", "/user/login",