Skip to content

Commit

Permalink
add integration test for Create Repository with merge method specified
Browse files Browse the repository at this point in the history
  • Loading branch information
ryangribble committed Oct 1, 2016
1 parent aedcdb6 commit aabc3a3
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions Octokit.Tests.Integration/Clients/RepositoriesClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,36 @@ await Assert.ThrowsAsync<PrivateRepositoryQuotaExceededException>(
Task.WhenAll(deleteRepos).Wait();
}
}

[IntegrationTest]
public async Task CreatesARepositoryWithRequestedMergeMethod()
{
var github = Helper.GetAuthenticatedClient();
var repoName = Helper.MakeNameWithTimestamp("public-repo");

var newRepository = new NewRepository(repoName)
{
AllowMergeCommit = false,
AllowSquashMerge = true,
AllowRebaseMerge = false
};

using (var context = await github.CreateRepositoryContext(newRepository))
{
var createdRepository = context.Repository;

Assert.Equal(repoName, createdRepository.Name);
Assert.False(createdRepository.AllowMergeCommit);
Assert.True(createdRepository.AllowSquashMerge);
Assert.False(createdRepository.AllowRebaseMerge);

var repository = await github.Repository.Get(Helper.UserName, repoName);
Assert.Equal(repoName, repository.Name);
Assert.False(repository.AllowMergeCommit);
Assert.True(repository.AllowSquashMerge);
Assert.False(repository.AllowRebaseMerge);
}
}
}

public class TheCreateMethodForOrganization
Expand Down

0 comments on commit aabc3a3

Please sign in to comment.