0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-03-06 03:31:51 -05:00
forgejo/models
Gusted 85505e0f81
[MODERATION] Refactor integration testing (squash)
- Motivation for this PR is that I'd noticed that a lot of repeated
calls are happening between the test functions and that certain tests
weren't using helper functions like `GetCSRF`, therefor this refactor of
the integration tests to keep it: clean, small and hopefully more
maintainable and understandable.
- There are now three integration tests: `TestBlockUser`,
`TestBlockUserFromOrganization` and `TestBlockActions` (and has been
moved in that order in the source code).
- `TestBlockUser` is for doing blocking related actions as an user and
`TestBlockUserFromOrganization` as an organisation, even though they
execute the same kind of tests they do not share any database calls or
logic and therefor it currently doesn't make sense to merge them
together (hopefully such oppurtinutiy might be presented in the future).
- `TestBlockActions` now contain all tests for actions that should be
blocked after blocking has happened, most tests now share the same doer
and blocked users and a extra fixture has been added to make this
possible for the comment test.
- Less code, more comments and more re-use between tests.

(cherry picked from commit ffb393213d)
2023-08-29 10:03:39 +02:00
..
actions [CLI] implement forgejo-cli 2023-08-29 08:22:02 +02:00
activities [MODERATION] User blocking 2023-08-29 10:03:29 +02:00
admin
asymkey
auth [TESTS] oauth2: add integration test helpers 2023-08-29 08:47:10 +02:00
avatars
db [SEMVER] store SemVer in ForgejoSemVer after a database upgrade 2023-08-29 08:47:11 +02:00
dbfs
fixtures [MODERATION] Refactor integration testing (squash) 2023-08-29 10:03:39 +02:00
forgejo/semver [UPGRADE] add sanity checks for [storage*] 2023-08-29 08:47:11 +02:00
forgejo_migrations [SEMVER] store SemVer in ForgejoSemVer after a database upgrade 2023-08-29 08:47:11 +02:00
git Add link to job details and tooltip to commit status in repo list in dashboard (#26326) 2023-08-21 15:26:10 +08:00
issues [MODERATION] User blocking 2023-08-29 10:03:29 +02:00
migrations [UPGRADE] run sanity checks before the database is upgraded 2023-08-29 08:47:11 +02:00
organization
packages Fix NuGet search endpoints (#25613) 2023-08-14 02:50:55 +00:00
perm
project Refactor project templates (#26448) 2023-08-12 10:30:28 +00:00
pull
repo [MODERATION] User blocking 2023-08-29 10:03:29 +02:00
secret feat(API): update and delete secret for managing organization secrets (#26660) 2023-08-24 02:07:00 +00:00
shared/types
system
unit
unittest
user [MODERATION] User blocking 2023-08-29 10:03:29 +02:00
webhook
error.go
fixture_generation.go
fixture_test.go
main_test.go
migrate.go
migrate_test.go
org.go
org_team.go
org_team_test.go
org_test.go
repo.go chore(actions): support cron schedule task (#26655) 2023-08-24 03:06:51 +00:00
repo_collaboration.go
repo_collaboration_test.go
repo_test.go
repo_transfer.go
repo_transfer_test.go