diff --git a/organization.go b/organization.go index 357bcf8..931cacd 100644 --- a/organization.go +++ b/organization.go @@ -13,14 +13,14 @@ import ( // https://developers.trello.com/reference/#organizations type Organization struct { client *Client - ID string `json:"id"` - Name string `json:"name"` - DisplayName string `json:"displayName"` - Desc string `json:"desc"` - URL string `json:"url"` - Website string `json:"website"` - Products []string `json:"products"` - PowerUps []string `json:"powerUps"` + ID string `json:"id"` + Name string `json:"name"` + DisplayName string `json:"displayName"` + Desc string `json:"desc"` + URL string `json:"url"` + Website string `json:"website"` + Products []int `json:"products"` + PowerUps []int `json:"powerUps"` } // GetOrganization takes an organization id and Arguments and either diff --git a/organization_test.go b/organization_test.go index f2ea111..7fa652e 100644 --- a/organization_test.go +++ b/organization_test.go @@ -14,6 +14,18 @@ func TestGetOrganization(t *testing.T) { if organization.DisplayName != "Culture Foundry" { t.Errorf("Expected name 'Culture Foundry'. Got '%s'.", organization.DisplayName) } + if len(organization.PowerUps) != 1 { + t.Errorf("Expected PowerUps to have length of 1 but was %d", len(organization.PowerUps)) + } + if organization.PowerUps[0] != 42 { + t.Errorf("Expected first PowerUp to be %d but was %d", 42, organization.PowerUps[0]) + } + if len(organization.Products) != 1 { + t.Errorf("Expected Products to have length of 1 but was %d", len(organization.Products)) + } + if organization.Products[0] != 110 { + t.Errorf("Expected first Product to be %d but was %d", 110, organization.Products[0]) + } } func TestGetBoardsInOrganization(t *testing.T) { diff --git a/testdata/organizations/culturefoundry.json b/testdata/organizations/culturefoundry.json index 18936be..46d921a 100644 --- a/testdata/organizations/culturefoundry.json +++ b/testdata/organizations/culturefoundry.json @@ -7,6 +7,6 @@ "url": "https://trello.com/culturefoundry", "website": null, "logoHash": null, - "products": [], - "powerUps": [] + "products": [110], + "powerUps": [42] }