@@ -105,7 +105,7 @@ Describe 'GitHubRepositories\New-GitHubRepository' {
105
105
}
106
106
}
107
107
108
- Context - Name ' When creating a repository with all possible settings' - Fixture {
108
+ Context - Name ' When creating a public repository with all possible settings' - Fixture {
109
109
BeforeAll - ScriptBlock {
110
110
$repoName = ([Guid ]::NewGuid().Guid)
111
111
$testGitIgnoreTemplate = (Get-GitHubGitIgnore )[0 ]
@@ -122,6 +122,7 @@ Describe 'GitHubRepositories\New-GitHubRepository' {
122
122
DisallowSquashMerge = $true
123
123
DisallowMergeCommit = $true
124
124
DisallowRebaseMerge = $false
125
+ AllowAutoMerge = $true
125
126
DeleteBranchOnMerge = $true
126
127
GitIgnoreTemplate = $testGitIgnoreTemplate
127
128
LicenseTemplate = $testLicenseTemplate
@@ -146,6 +147,7 @@ Describe 'GitHubRepositories\New-GitHubRepository' {
146
147
$repo.allow_squash_merge | Should - BeFalse
147
148
$repo.allow_merge_commit | Should - BeFalse
148
149
$repo.allow_rebase_merge | Should - BeTrue
150
+ $repo.allow_auto_merge | Should - BeTrue
149
151
$repo.delete_branch_on_merge | Should - BeTrue
150
152
$repo.is_template | Should - BeTrue
151
153
}
@@ -166,14 +168,15 @@ Describe 'GitHubRepositories\New-GitHubRepository' {
166
168
}
167
169
}
168
170
169
- Context - Name ' When creating a repository with alternative Merge settings' - Fixture {
171
+ Context - Name ' When creating a public repository with alternative Merge settings' - Fixture {
170
172
BeforeAll - ScriptBlock {
171
173
$repoName = ([Guid ]::NewGuid().Guid)
172
174
$newGitHubRepositoryParms = @ {
173
175
RepositoryName = $repoName
174
176
DisallowSquashMerge = $true
175
177
DisallowMergeCommit = $false
176
178
DisallowRebaseMerge = $true
179
+ AllowAutoMerge = $false
177
180
}
178
181
$repo = New-GitHubRepository @newGitHubRepositoryParms
179
182
}
@@ -187,6 +190,7 @@ Describe 'GitHubRepositories\New-GitHubRepository' {
187
190
$repo.allow_squash_merge | Should - BeFalse
188
191
$repo.allow_merge_commit | Should - BeTrue
189
192
$repo.allow_rebase_merge | Should - BeFalse
193
+ $repo.allow_auto_merge | Should - BeFalse
190
194
}
191
195
192
196
AfterAll - ScriptBlock {
@@ -719,6 +723,48 @@ Describe 'GitHubRepositories\Set-GitHubRepository' {
719
723
$repo = New-GitHubRepository - RepositoryName $repoName
720
724
}
721
725
726
+ Context - Name ' When updating a public repository with auto-merge set to true' {
727
+ BeforeAll - ScriptBlock {
728
+ $updateGithubRepositoryParms = @ {
729
+ OwnerName = $repo.owner.login
730
+ RepositoryName = $repoName
731
+ AllowAutoMerge = $true
732
+ }
733
+
734
+ $updatedRepo = Set-GitHubRepository @updateGithubRepositoryParms - PassThru
735
+ }
736
+
737
+ It ' Should return an object of the correct type' {
738
+ $updatedRepo | Should - BeOfType PSCustomObject
739
+ }
740
+
741
+ It ' Should return the correct properties' {
742
+ $updatedRepo.name | Should - Be $repoName
743
+ $updatedRepo.allow_auto_merge | Should - BeTrue
744
+ }
745
+ }
746
+
747
+ Context - Name ' When updating a public repository with auto-merge set to false' {
748
+ BeforeAll - ScriptBlock {
749
+ $updateGithubRepositoryParms = @ {
750
+ OwnerName = $repo.owner.login
751
+ RepositoryName = $repoName
752
+ AllowAutoMerge = $false
753
+ }
754
+
755
+ $updatedRepo = Set-GitHubRepository @updateGithubRepositoryParms - PassThru
756
+ }
757
+
758
+ It ' Should return an object of the correct type' {
759
+ $updatedRepo | Should - BeOfType PSCustomObject
760
+ }
761
+
762
+ It ' Should return the correct properties' {
763
+ $updatedRepo.name | Should - Be $repoName
764
+ $updatedRepo.allow_auto_merge | Should - BeFalse
765
+ }
766
+ }
767
+
722
768
Context - Name ' When updating a repository with all possible settings' {
723
769
BeforeAll - ScriptBlock {
724
770
$updateGithubRepositoryParms = @ {
0 commit comments