From ea86b89b81392447a23c3d4018d76424663b4514 Mon Sep 17 00:00:00 2001 From: Lukas Hass Date: Thu, 1 Feb 2024 14:43:58 +0100 Subject: [PATCH] add test --- server/forge/gitlab/gitlab_test.go | 6 ++++++ server/forge/gitlab/testdata/projects.go | 2 +- server/forge/gitlab/testdata/testdata.go | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/server/forge/gitlab/gitlab_test.go b/server/forge/gitlab/gitlab_test.go index a286f15b5a..88fff4f294 100644 --- a/server/forge/gitlab/gitlab_test.go +++ b/server/forge/gitlab/gitlab_test.go @@ -103,6 +103,12 @@ func Test_GitLab(t *testing.T) { _, err := client.Repo(ctx, &user, "0", "not-existed", "not-existed") assert.Error(t, err) }) + + g.It("Should return repo with push access, when user inherits membership from namespace", func() { + _repo, err := client.Repo(ctx, &user, "6", "brightbox", "puppet") + assert.NoError(t, err) + assert.True(t, _repo.Perm.Push) + }) }) // Test activate method diff --git a/server/forge/gitlab/testdata/projects.go b/server/forge/gitlab/testdata/projects.go index 6780861dd2..5e3a584e87 100644 --- a/server/forge/gitlab/testdata/projects.go +++ b/server/forge/gitlab/testdata/projects.go @@ -329,7 +329,7 @@ var project6PayloadMembers = []byte(` "locked": false, "avatar_url": "https://example.com/uploads/-/system/user/avatar/3/avatar.png", "web_url": "https://example.com/some_user", - "access_level": 10, + "access_level": 30, "created_at": "2024-01-16T12:39:58.912Z", "expires_at": null } diff --git a/server/forge/gitlab/testdata/testdata.go b/server/forge/gitlab/testdata/testdata.go index 9c09bf1f7a..8f660ef300 100644 --- a/server/forge/gitlab/testdata/testdata.go +++ b/server/forge/gitlab/testdata/testdata.go @@ -46,6 +46,7 @@ func NewServer(t *testing.T) *httptest.Server { w.Write(project4Payload) return case "/api/v4/projects/brightbox/puppet": + case "/api/v4/projects/6": w.Write(project6Payload) return case "/api/v4/projects/4/hooks":