Skip to content

Commit 4b27602

Browse files
committed
Add test for APIMeta JSON marshaling (google#1457)
Relates to google#55.
1 parent 1da482d commit 4b27602

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

‎github/misc_test.go‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,26 @@ func TestGetCodeOfConduct(t *testing.T) {
128128
}
129129
}
130130

131+
func TestAPIMeta_marshal(t *testing.T) {
132+
testJSONMarshal(t, &APIMeta{}, "{}")
133+
134+
a := &APIMeta{
135+
Hooks: []string{"h"},
136+
Git: []string{"g"},
137+
VerifiablePasswordAuthentication: Bool(true),
138+
Pages: []string{"p"},
139+
Importer: []string{"i"},
140+
}
141+
want := `{
142+
"hooks":["h"],
143+
"git":["g"],
144+
"verifiable_password_authentication":true,
145+
"pages":["p"],"importer":["i"]
146+
}`
147+
148+
testJSONMarshal(t, a, want)
149+
}
150+
131151
func TestAPIMeta(t *testing.T) {
132152
client, mux, _, teardown := setup()
133153
defer teardown()

0 commit comments

Comments
 (0)