Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Add file_template_project_id attribute to Group Struct
Browse files Browse the repository at this point in the history
Added a test to ensure that the value unmarshaled properly as well.
  • Loading branch information
RicePatrick committed Feb 27, 2022
1 parent 4b55115 commit d5d59a7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ type Group struct {
LDAPCN string `json:"ldap_cn"`
LDAPAccess AccessLevelValue `json:"ldap_access"`
LDAPGroupLinks []*LDAPGroupLink `json:"ldap_group_links"`
FileTemplateProjectId int `json:"file_template_project_id"`
SharedRunnersMinutesLimit int `json:"shared_runners_minutes_limit"`
ExtraSharedRunnersMinutesLimit int `json:"extra_shared_runners_minutes_limit"`
PreventForkingOutsideGroup bool `json:"prevent_forking_outside_group"`
Expand Down
22 changes: 22 additions & 0 deletions groups_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,28 @@ func TestGetGroup(t *testing.T) {
}
}

func TestGetGroupWithFileTemplateId(t *testing.T) {
mux, server, client := setup(t)
defer teardown(server)

mux.HandleFunc("/api/v4/groups/g",
func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodGet)
fmt.Fprint(w, `{"id": 1, "name": "g","file_template_project_id": 12345}`)
})

group, _, err := client.Groups.GetGroup("g", &GetGroupOptions{})
if err != nil {
t.Errorf("Groups.GetGroup returned error: %v", err)
}

want := &Group{ID: 1, Name: "g", FileTemplateProjectId: 12345}
if !reflect.DeepEqual(want, group) {
t.Errorf("Groups.GetGroup returned %+v, want %+v", group, want)
}

}

func TestCreateGroup(t *testing.T) {
mux, server, client := setup(t)
defer teardown(server)
Expand Down

0 comments on commit d5d59a7

Please sign in to comment.