Skip to content

Commit d5d59a7

Browse files
committed
Add file_template_project_id attribute to Group Struct
Added a test to ensure that the value unmarshaled properly as well.
1 parent 4b55115 commit d5d59a7

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

groups.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ type Group struct {
7171
LDAPCN string `json:"ldap_cn"`
7272
LDAPAccess AccessLevelValue `json:"ldap_access"`
7373
LDAPGroupLinks []*LDAPGroupLink `json:"ldap_group_links"`
74+
FileTemplateProjectId int `json:"file_template_project_id"`
7475
SharedRunnersMinutesLimit int `json:"shared_runners_minutes_limit"`
7576
ExtraSharedRunnersMinutesLimit int `json:"extra_shared_runners_minutes_limit"`
7677
PreventForkingOutsideGroup bool `json:"prevent_forking_outside_group"`

groups_test.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,28 @@ func TestGetGroup(t *testing.T) {
4949
}
5050
}
5151

52+
func TestGetGroupWithFileTemplateId(t *testing.T) {
53+
mux, server, client := setup(t)
54+
defer teardown(server)
55+
56+
mux.HandleFunc("/api/v4/groups/g",
57+
func(w http.ResponseWriter, r *http.Request) {
58+
testMethod(t, r, http.MethodGet)
59+
fmt.Fprint(w, `{"id": 1, "name": "g","file_template_project_id": 12345}`)
60+
})
61+
62+
group, _, err := client.Groups.GetGroup("g", &GetGroupOptions{})
63+
if err != nil {
64+
t.Errorf("Groups.GetGroup returned error: %v", err)
65+
}
66+
67+
want := &Group{ID: 1, Name: "g", FileTemplateProjectId: 12345}
68+
if !reflect.DeepEqual(want, group) {
69+
t.Errorf("Groups.GetGroup returned %+v, want %+v", group, want)
70+
}
71+
72+
}
73+
5274
func TestCreateGroup(t *testing.T) {
5375
mux, server, client := setup(t)
5476
defer teardown(server)

0 commit comments

Comments
 (0)