Skip to content

Commit

Permalink
test: add JSON marshalling test for Organizations
Browse files Browse the repository at this point in the history
Helps google#55
  • Loading branch information
sgarciac committed Oct 8, 2019
1 parent 8e305d0 commit c5c562f
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions github/orgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,38 @@ import (
"testing"
)

func TestOrganization_marshal(t *testing.T) {
testJSONMarshal(t, &Organization{}, "{}")

o := &Organization{
BillingEmail: String("[email protected]"),
Blog: String("https://github.com/blog"),
Company: String("GitHub"),
Email: String("[email protected]"),
Location: String("San Francisco"),
Name: String("github"),
Description: String("GitHub, the company."),
DefaultRepoPermission: String("read"),
MembersCanCreateRepos: Bool(true),
MembersAllowedRepositoryCreationType: String("all"),
}
want := `
{
"billing_email": "[email protected]",
"blog": "https://github.com/blog",
"company": "GitHub",
"email": "[email protected]",
"location": "San Francisco",
"name": "github",
"description": "GitHub, the company.",
"default_repository_permission": "read",
"members_can_create_repositories": true,
"members_allowed_repository_creation_type": "all"
}
`
testJSONMarshal(t, o, want)
}

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

0 comments on commit c5c562f

Please sign in to comment.