Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
lukashass committed Feb 1, 2024
1 parent 3ebb4d8 commit ea86b89
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions server/forge/gitlab/gitlab_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion server/forge/gitlab/testdata/projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
1 change: 1 addition & 0 deletions server/forge/gitlab/testdata/testdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down

0 comments on commit ea86b89

Please sign in to comment.