c572fcfe04
Rename the Go module path from code.gitea.io/gitea to git.mokoconsulting.tech/MokoConsulting/MokoGitea across the entire codebase. Scope: - go.mod module declaration - 2,235 Go source files (import paths) - Dockerfile WORKDIR and COPY paths - Swagger API templates - golangci.yml linter config External dependencies (code.gitea.io/gitea-vet, code.gitea.io/sdk/gitea, gitea.com/gitea/act, etc.) are intentionally NOT renamed — they are separate upstream modules. Closes #132 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
37 lines
1.2 KiB
Go
37 lines
1.2 KiB
Go
// Copyright 2025 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
package feed_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"git.mokoconsulting.tech/MokoConsulting/MokoGitea/models/unittest"
|
|
user_model "git.mokoconsulting.tech/MokoConsulting/MokoGitea/models/user"
|
|
"git.mokoconsulting.tech/MokoConsulting/MokoGitea/routers/web/feed"
|
|
"git.mokoconsulting.tech/MokoConsulting/MokoGitea/services/contexttest"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestMain(m *testing.M) {
|
|
unittest.MainTest(m)
|
|
}
|
|
|
|
func TestCheckGetOrgFeedsAsOrgMember(t *testing.T) {
|
|
unittest.PrepareTestEnv(t)
|
|
t.Run("OrgMember", func(t *testing.T) {
|
|
ctx, resp := contexttest.MockContext(t, "org3.atom")
|
|
ctx.ContextUser = unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 3})
|
|
contexttest.LoadUser(t, ctx, 2)
|
|
feed.ShowUserFeedAtom(ctx)
|
|
assert.Contains(t, resp.Body.String(), "<entry>") // Should contain 1 private entry
|
|
})
|
|
t.Run("NonOrgMember", func(t *testing.T) {
|
|
ctx, resp := contexttest.MockContext(t, "org3.atom")
|
|
ctx.ContextUser = unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 3})
|
|
contexttest.LoadUser(t, ctx, 5)
|
|
feed.ShowUserFeedAtom(ctx)
|
|
assert.NotContains(t, resp.Body.String(), "<entry>") // Should not contain any entries
|
|
})
|
|
}
|