Skip to content

Commit 378e484

Browse files
authored
Add test case for JSON resource marshaling
Helps: #55.
1 parent 40bb87d commit 378e484

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

github/repos_merging_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,21 @@ func TestRepositoriesService_Merge(t *testing.T) {
6262
return resp, err
6363
})
6464
}
65+
66+
func TestRepositoryMergeRequest_Marshal(t *testing.T) {
67+
testJSONMarshal(t, &RepositoryMergeRequest{}, "{}")
68+
69+
u := &RepositoryMergeRequest{
70+
Base: String("base"),
71+
Head: String("head"),
72+
CommitMessage: String("cm"),
73+
}
74+
75+
want := `{
76+
"base": "base",
77+
"head": "head",
78+
"commit_message": "cm"
79+
}`
80+
81+
testJSONMarshal(t, u, want)
82+
}

0 commit comments

Comments
 (0)