Browse Source

Add the Description field for organization teams.

Closes #265.
John Engelman 10 years ago
committed by Will Norris
parent
commit
e5c7fc4800
2 changed files with 7 additions and 6 deletions
  1. +5
    -4
      github/orgs_teams.go
  2. +2
    -2
      github/orgs_teams_test.go

+ 5
- 4
github/orgs_teams.go View File

@ -10,10 +10,11 @@ import "fmt"
// Team represents a team within a GitHub organization. Teams are used to
// manage access to an organization's repositories.
type Team struct {
ID *int `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
URL *string `json:"url,omitempty"`
Slug *string `json:"slug,omitempty"`
ID *int `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
URL *string `json:"url,omitempty"`
Slug *string `json:"slug,omitempty"`
// Permission is deprecated when creating or editing a team in an org
// using the new GitHub permission model. It no longer identifies the


+ 2
- 2
github/orgs_teams_test.go View File

@ -46,7 +46,7 @@ func TestOrganizationsService_GetTeam(t *testing.T) {
mux.HandleFunc("/teams/1", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
fmt.Fprint(w, `{"id":1, "name":"n", "url":"u", "slug": "s", "permission":"p"}`)
fmt.Fprint(w, `{"id":1, "name":"n", "description": "d", "url":"u", "slug": "s", "permission":"p"}`)
})
team, _, err := client.Organizations.GetTeam(1)
@ -54,7 +54,7 @@ func TestOrganizationsService_GetTeam(t *testing.T) {
t.Errorf("Organizations.GetTeam returned error: %v", err)
}
want := &Team{ID: Int(1), Name: String("n"), URL: String("u"), Slug: String("s"), Permission: String("p")}
want := &Team{ID: Int(1), Name: String("n"), Description: String("d"), URL: String("u"), Slug: String("s"), Permission: String("p")}
if !reflect.DeepEqual(team, want) {
t.Errorf("Organizations.GetTeam returned %+v, want %+v", team, want)
}


Loading…
Cancel
Save