@@ -481,7 +481,7 @@ func TestRepositoriesService_GetBranchProtection(t *testing.T) {
481
481
482
482
testMethod (t , r , "GET" )
483
483
testHeader (t , r , "Accept" , mediaTypeProtectedBranchesPreview )
484
- fmt .Fprintf (w , `{"required_status_checks":{"include_admins":true,"strict":true,"contexts":["continuous-integration"]},"restrictions":{"users":[{"id":1,"login":"u"}],"teams":[{"id":2,"slug":"t"}]}}` )
484
+ fmt .Fprintf (w , `{"required_status_checks":{"include_admins":true,"strict":true,"contexts":["continuous-integration"]},"required_pull_request_reviews":{"include_admins":true}," restrictions":{"users":[{"id":1,"login":"u"}],"teams":[{"id":2,"slug":"t"}]}}` )
485
485
})
486
486
487
487
protection , _ , err := client .Repositories .GetBranchProtection ("o" , "r" , "b" )
@@ -491,9 +491,12 @@ func TestRepositoriesService_GetBranchProtection(t *testing.T) {
491
491
492
492
want := & Protection {
493
493
RequiredStatusChecks : & RequiredStatusChecks {
494
- IncludeAdmins : Bool (true ),
495
- Strict : Bool (true ),
496
- Contexts : & []string {"continuous-integration" },
494
+ IncludeAdmins : true ,
495
+ Strict : true ,
496
+ Contexts : []string {"continuous-integration" },
497
+ },
498
+ RequiredPullRequestReviews : & RequiredPullRequestReviews {
499
+ IncludeAdmins : true ,
497
500
},
498
501
Restrictions : & BranchRestrictions {
499
502
Users : []* User {
@@ -515,13 +518,16 @@ func TestRepositoriesService_UpdateBranchProtection(t *testing.T) {
515
518
516
519
input := & ProtectionRequest {
517
520
RequiredStatusChecks : & RequiredStatusChecks {
518
- IncludeAdmins : Bool (true ),
519
- Strict : Bool (true ),
520
- Contexts : & []string {"continuous-integration" },
521
+ IncludeAdmins : true ,
522
+ Strict : true ,
523
+ Contexts : []string {"continuous-integration" },
524
+ },
525
+ RequiredPullRequestReviews : & RequiredPullRequestReviews {
526
+ IncludeAdmins : true ,
521
527
},
522
528
Restrictions : & BranchRestrictionsRequest {
523
- Users : & []string {"u" },
524
- Teams : & []string {"t" },
529
+ Users : []string {"u" },
530
+ Teams : []string {"t" },
525
531
},
526
532
}
527
533
@@ -534,7 +540,7 @@ func TestRepositoriesService_UpdateBranchProtection(t *testing.T) {
534
540
t .Errorf ("Request body = %+v, want %+v" , v , input )
535
541
}
536
542
testHeader (t , r , "Accept" , mediaTypeProtectedBranchesPreview )
537
- fmt .Fprintf (w , `{"required_status_checks":{"include_admins":true,"strict":true,"contexts":["continuous-integration"]},"restrictions":{"users":[{"id":1,"login":"u"}],"teams":[{"id":2,"slug":"t"}]}}` )
543
+ fmt .Fprintf (w , `{"required_status_checks":{"include_admins":true,"strict":true,"contexts":["continuous-integration"]},"required_pull_request_reviews":{"include_admins":true}," restrictions":{"users":[{"id":1,"login":"u"}],"teams":[{"id":2,"slug":"t"}]}}` )
538
544
})
539
545
540
546
protection , _ , err := client .Repositories .UpdateBranchProtection ("o" , "r" , "b" , input )
@@ -544,9 +550,12 @@ func TestRepositoriesService_UpdateBranchProtection(t *testing.T) {
544
550
545
551
want := & Protection {
546
552
RequiredStatusChecks : & RequiredStatusChecks {
547
- IncludeAdmins : Bool (true ),
548
- Strict : Bool (true ),
549
- Contexts : & []string {"continuous-integration" },
553
+ IncludeAdmins : true ,
554
+ Strict : true ,
555
+ Contexts : []string {"continuous-integration" },
556
+ },
557
+ RequiredPullRequestReviews : & RequiredPullRequestReviews {
558
+ IncludeAdmins : true ,
550
559
},
551
560
Restrictions : & BranchRestrictions {
552
561
Users : []* User {
0 commit comments