Skip to content

Commit

Permalink
test: add JSON marshalling test for Organizations
Browse files Browse the repository at this point in the history
Helps #55
  • Loading branch information
sgarciac committed Oct 8, 2019
1 parent 856d10e commit 2a892c7
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("support@github.com"),
Blog: String("https://github.com/blog"),
Company: String("GitHub"),
Email: String("support@github.com"),
Location: String("San Francisco"),
Name: String("github"),
Description: String("GitHub, the company."),
DefaultRepoPermission: String("read"),
MembersCanCreateRepos: Bool(true),
MembersAllowedRepositoryCreationType: String("all"),
}
want := `
{
"billing_email": "support@github.com",
"blog": "https://github.com/blog",
"company": "GitHub",
"email": "support@github.com",
"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 2a892c7

Please sign in to comment.