[PR #2123] [MERGED] Less verbose integration tests #16242

Closed
opened 2025-11-02 12:05:43 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/2123
Author: @ethantkoenig
Created: 7/7/2017
Status: Merged
Merged: 7/7/2017
Merged by: @bkcsoft

Base: masterHead: refactor/integration


📝 Commits (3)

📊 Changes

24 files changed (+122 additions, -223 deletions)

View changed files

📝 integrations/api_branch_test.go (+1 -1)
📝 integrations/api_comment_test.go (+1 -2)
📝 integrations/api_issue_label_test.go (+2 -4)
📝 integrations/api_issue_test.go (+2 -4)
📝 integrations/api_pull_test.go (+1 -2)
📝 integrations/api_repo_test.go (+2 -6)
📝 integrations/api_team_test.go (+1 -2)
📝 integrations/change_default_branch_test.go (+7 -19)
📝 integrations/delete_user_test.go (+4 -11)
📝 integrations/editor_test.go (+15 -32)
📝 integrations/integration_test.go (+23 -7)
📝 integrations/internal_test.go (+2 -2)
📝 integrations/issue_test.go (+8 -16)
📝 integrations/pull_compare_test.go (+2 -3)
📝 integrations/pull_create_test.go (+3 -6)
📝 integrations/pull_merge_test.go (+9 -18)
📝 integrations/release_test.go (+6 -12)
📝 integrations/repo_commits_test.go (+4 -8)
📝 integrations/repo_fork_test.go (+5 -10)
📝 integrations/repo_migrate_test.go (+2 -4)

...and 4 more files

📄 Description

Changes to make integration tests less verbose

  • Add expected status code argument to MakeRequest(..), which saves a lot of assert.EqualValues(t, http.StatusXYZ, resp.HeaderCode) lines
  • Helper function to get CSRF token (GetCSRF(..))
  • Helper function for getting redirect URL (RedirectURL(..))

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/2123 **Author:** [@ethantkoenig](https://github.com/ethantkoenig) **Created:** 7/7/2017 **Status:** ✅ Merged **Merged:** 7/7/2017 **Merged by:** [@bkcsoft](https://github.com/bkcsoft) **Base:** `master` ← **Head:** `refactor/integration` --- ### 📝 Commits (3) - [`d330fb1`](https://github.com/go-gitea/gitea/commit/d330fb111ddd86ec69bcadacd5e06feb09e0840e) Helper functions for intergration test boilerplate - [`320f04f`](https://github.com/go-gitea/gitea/commit/320f04fab87651beab79fc0e8f4f36f533201d41) Redirect helper - [`bd923e0`](https://github.com/go-gitea/gitea/commit/bd923e00a1f1db24e601d929189bb180f63905d4) typos ### 📊 Changes **24 files changed** (+122 additions, -223 deletions) <details> <summary>View changed files</summary> 📝 `integrations/api_branch_test.go` (+1 -1) 📝 `integrations/api_comment_test.go` (+1 -2) 📝 `integrations/api_issue_label_test.go` (+2 -4) 📝 `integrations/api_issue_test.go` (+2 -4) 📝 `integrations/api_pull_test.go` (+1 -2) 📝 `integrations/api_repo_test.go` (+2 -6) 📝 `integrations/api_team_test.go` (+1 -2) 📝 `integrations/change_default_branch_test.go` (+7 -19) 📝 `integrations/delete_user_test.go` (+4 -11) 📝 `integrations/editor_test.go` (+15 -32) 📝 `integrations/integration_test.go` (+23 -7) 📝 `integrations/internal_test.go` (+2 -2) 📝 `integrations/issue_test.go` (+8 -16) 📝 `integrations/pull_compare_test.go` (+2 -3) 📝 `integrations/pull_create_test.go` (+3 -6) 📝 `integrations/pull_merge_test.go` (+9 -18) 📝 `integrations/release_test.go` (+6 -12) 📝 `integrations/repo_commits_test.go` (+4 -8) 📝 `integrations/repo_fork_test.go` (+5 -10) 📝 `integrations/repo_migrate_test.go` (+2 -4) _...and 4 more files_ </details> ### 📄 Description Changes to make integration tests less verbose - Add expected status code argument to `MakeRequest(..)`, which saves a lot of `assert.EqualValues(t, http.StatusXYZ, resp.HeaderCode)` lines - Helper function to get CSRF token (`GetCSRF(..)`) - Helper function for getting redirect URL (`RedirectURL(..)`) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 12:05:43 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#16242