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

Commit

Permalink
Merge pull request #1394 from PatrickRice-KSC/add_file_template_proje…
Browse files Browse the repository at this point in the history
…ct_id

Add file_template_project_id attribute to Group Struct
  • Loading branch information
svanharmelen authored Mar 2, 2022
2 parents 55d41c3 + d3eb6f8 commit b5c61e1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ type Group struct {
RequestAccessEnabled bool `json:"request_access_enabled"`
FullName string `json:"full_name"`
FullPath string `json:"full_path"`
FileTemplateProjectID int `json:"file_template_project_id"`
ParentID int `json:"parent_id"`
Projects []*Project `json:"projects"`
Statistics *StorageStatistics `json:"statistics"`
Expand Down
21 changes: 21 additions & 0 deletions groups_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,27 @@ 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 b5c61e1

Please sign in to comment.