Skip to content

Commit

Permalink
Add test case for JSON resource marshaling (#2539)
Browse files Browse the repository at this point in the history
  • Loading branch information
vaibhavgholap23 committed Oct 28, 2022
1 parent fd784db commit 2ac6fb8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions github/repos_environments_test.go
Expand Up @@ -426,3 +426,19 @@ func TestEnvironment_Marshal(t *testing.T) {

testJSONMarshal(t, repoEnv, want)
}

func TestBranchPolicy_Marshal(t *testing.T) {
testJSONMarshal(t, &BranchPolicy{}, "{}")

bp := &BranchPolicy{
ProtectedBranches: Bool(false),
CustomBranchPolicies: Bool(false),
}

want := `{
"protected_branches": false,
"custom_branch_policies": false
}`

testJSONMarshal(t, bp, want)
}

0 comments on commit 2ac6fb8

Please sign in to comment.