forgejo/tests/integration/api_repo_pulls_test.go
Minecon724 5016926d01
Some checks are pending
/ release (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (redis) (push) Blocked by required conditions
testing / test-remote-cacher (valkey) (push) Blocked by required conditions
testing / test-remote-cacher (garnet) (push) Blocked by required conditions
testing / test-remote-cacher (redict) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
Just merg
2025-03-29 20:14:01 +01:00

34 lines
857 B
Go

// Copyright 2021 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package integration
import (
"fmt"
"net/http"
"testing"
repo_model "forgejo.org/models/repo"
"forgejo.org/models/unittest"
api "forgejo.org/modules/structs"
"forgejo.org/tests"
"github.com/stretchr/testify/assert"
)
func TestAPIRepoPulls(t *testing.T) {
defer tests.PrepareTestEnv(t)()
// repo = user2/repo1
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1})
// issue id without assigned review member or review team
issueID := 5
req := NewRequest(t, "GET", fmt.Sprintf("/api/v1/repos/%s/%s/pulls/%d", repo.OwnerName, repo.Name, issueID))
res := MakeRequest(t, req, http.StatusOK)
var pr *api.PullRequest
DecodeJSON(t, res, &pr)
assert.NotNil(t, pr.RequestedReviewers)
assert.NotNil(t, pr.RequestedReviewersTeams)
}