Skip to content

Commit

Permalink
Merge pull request #1204 from TattsGroup/fix-repositories-uri
Browse files Browse the repository at this point in the history
RepositoriesClient.GetAllPublic() fails on GitHub Enterprise due to incorrect endpoint Uri
  • Loading branch information
shiftkey committed Mar 29, 2016
2 parents 5e37684 + b99d178 commit 1335f37
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Octokit.Tests/Clients/RepositoriesClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ public void RequestsTheCorrectUrlAndReturnsRepositories()
client.GetAllPublic();

connection.Received()
.GetAll<Repository>(Arg.Is<Uri>(u => u.ToString() == "/repositories"));
.GetAll<Repository>(Arg.Is<Uri>(u => u.ToString() == "repositories"));
}
}

Expand All @@ -285,7 +285,7 @@ public void RequestsTheCorrectUrl()
client.GetAllPublic(new PublicRepositoryRequest(364));

connection.Received()
.GetAll<Repository>(Arg.Is<Uri>(u => u.ToString() == "/repositories?since=364"));
.GetAll<Repository>(Arg.Is<Uri>(u => u.ToString() == "repositories?since=364"));
}

[Fact]
Expand All @@ -297,7 +297,7 @@ public void SendsTheCorrectParameter()
client.GetAllPublic(new PublicRepositoryRequest(364));

connection.Received()
.GetAll<Repository>(Arg.Is<Uri>(u => u.ToString() == "/repositories?since=364"));
.GetAll<Repository>(Arg.Is<Uri>(u => u.ToString() == "repositories?since=364"));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public class TheGetAllPublicRepositoriesSinceMethod
[Fact]
public async Task ReturnsEveryPageOfRepositories()
{
var firstPageUrl = new Uri("/repositories?since=364", UriKind.Relative);
var firstPageUrl = new Uri("repositories?since=364", UriKind.Relative);
var secondPageUrl = new Uri("https://example.com/page/2");
var firstPageLinks = new Dictionary<string, Uri> { { "next", secondPageUrl } };
IApiResponse<List<Repository>> firstPageResponse = new ApiResponse<List<Repository>>(
Expand Down
4 changes: 2 additions & 2 deletions Octokit/Helpers/ApiUrls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static partial class ApiUrls
/// </summary>
public static Uri AllPublicRepositories()
{
return "/repositories".FormatUri();
return "repositories".FormatUri();
}

/// <summary>
Expand All @@ -35,7 +35,7 @@ public static Uri AllPublicRepositories()
/// <param name="since">The integer ID of the last Repository that you’ve seen.</param>
public static Uri AllPublicRepositories(long since)
{
return "/repositories?since={0}".FormatUri(since);
return "repositories?since={0}".FormatUri(since);
}

/// <summary>
Expand Down

0 comments on commit 1335f37

Please sign in to comment.