forked from go-gitea/gitea
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main'
* upstream/main: Fix install page context, make the install page tests really test (go-gitea#24858) Add validations.required check to dropdown field (go-gitea#24849) Use Go 1.20 for next release (go-gitea#24859) Add gitea manager reload-templates command (go-gitea#24843) Remove `In your repositories` link in milestones dashboard (go-gitea#24853) Fix 500 error when select `No assignee` filter in issue list page (go-gitea#24854) Add IsErrRepoFilesAlreadyExist check when fork repo (go-gitea#24678) Fix missing yes/no in delete time log modal (go-gitea#24851) Fix document and improve comment (go-gitea#24844) # Conflicts: # web_src/css/base.css
- Loading branch information
Showing
24 changed files
with
135 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module code.gitea.io/gitea | ||
|
||
go 1.19 | ||
go 1.20 | ||
|
||
require ( | ||
code.gitea.io/actions-proto-go v0.2.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,41 @@ | ||
// Copyright 2021 The Gitea Authors. All rights reserved. | ||
// Copyright 2023 The Gitea Authors. All rights reserved. | ||
// SPDX-License-Identifier: MIT | ||
|
||
package install | ||
|
||
import ( | ||
"context" | ||
"net/http/httptest" | ||
"path/filepath" | ||
"testing" | ||
|
||
"code.gitea.io/gitea/models/unittest" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestRoutes(t *testing.T) { | ||
// TODO: this test seems not really testing the handlers | ||
ctx, cancel := context.WithCancel(context.Background()) | ||
defer cancel() | ||
base := Routes(ctx) | ||
assert.NotNil(t, base) | ||
r := base.R.Routes()[1] | ||
routes := r.SubRoutes.Routes()[0] | ||
assert.EqualValues(t, "/", routes.Pattern) | ||
assert.Nil(t, routes.SubRoutes) | ||
assert.Len(t, routes.Handlers, 2) | ||
r := Routes() | ||
assert.NotNil(t, r) | ||
|
||
w := httptest.NewRecorder() | ||
req := httptest.NewRequest("GET", "/", nil) | ||
r.ServeHTTP(w, req) | ||
assert.EqualValues(t, 200, w.Code) | ||
assert.Contains(t, w.Body.String(), `class="page-content install"`) | ||
|
||
w = httptest.NewRecorder() | ||
req = httptest.NewRequest("GET", "/no-such", nil) | ||
r.ServeHTTP(w, req) | ||
assert.EqualValues(t, 404, w.Code) | ||
|
||
w = httptest.NewRecorder() | ||
req = httptest.NewRequest("GET", "/assets/img/gitea.svg", nil) | ||
r.ServeHTTP(w, req) | ||
assert.EqualValues(t, 200, w.Code) | ||
} | ||
|
||
func TestMain(m *testing.M) { | ||
unittest.MainTest(m, &unittest.TestOptions{ | ||
GiteaRootPath: filepath.Join("..", ".."), | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.