feat: set created_by as the default filter for /issues and /pulls (#5286)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5286
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
Co-committed-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
This commit is contained in:
Shiny Nematoda 2024-09-13 12:55:39 +00:00 committed by 0ko
parent a23ba1c6ac
commit 14abf65269
4 changed files with 27 additions and 8 deletions

View file

@ -28,6 +28,7 @@ func TestArchivedIssues(t *testing.T) {
ctx, _ := contexttest.MockContext(t, "issues")
contexttest.LoadUser(t, ctx, 30)
ctx.Req.Form.Set("state", "open")
ctx.Req.Form.Set("type", "your_repositories")
// Assume: User 30 has access to two Repos with Issues, one of the Repos being archived.
repos, _, _ := repo_model.GetUserRepositories(db.DefaultContext, &repo_model.SearchRepoOptions{Actor: ctx.Doer})
@ -73,6 +74,7 @@ func TestPulls(t *testing.T) {
ctx, _ := contexttest.MockContext(t, "pulls")
contexttest.LoadUser(t, ctx, 2)
ctx.Req.Form.Set("state", "open")
ctx.Req.Form.Set("type", "your_repositories")
Pulls(ctx)
assert.EqualValues(t, http.StatusOK, ctx.Resp.Status())