Skip to content

Commit

Permalink
make starfox preview header more explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
shiftkey committed Mar 6, 2020
1 parent 3d89a79 commit 17450fb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions Octokit.Tests/Clients/IssuesEventsClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public async Task RequestsCorrectUrl()
var client = new IssuesEventsClient(connection);

await client.GetAllForIssue("fake", "repo", 42);
connection.Received().GetAll<IssueEvent>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/issues/42/events"), null, "application/vnd.github.starfox-preview", Args.ApiOptions);
connection.Received().GetAll<IssueEvent>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/issues/42/events"), null, "application/vnd.github.starfox-preview+json", Args.ApiOptions);
}

[Fact]
Expand All @@ -37,7 +37,7 @@ public async Task RequestsCorrectUrlWithRepositoryId()

await client.GetAllForIssue(1, 42);

connection.Received().GetAll<IssueEvent>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/issues/42/events"), null, "application/vnd.github.starfox-preview", Args.ApiOptions);
connection.Received().GetAll<IssueEvent>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/issues/42/events"), null, "application/vnd.github.starfox-preview+json", Args.ApiOptions);
}

[Fact]
Expand All @@ -55,7 +55,7 @@ public async Task RequestsCorrectUrlWithApiOptions()

await client.GetAllForIssue("fake", "repo", 42, options);

connection.Received().GetAll<IssueEvent>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/issues/42/events"), null, "application/vnd.github.starfox-preview", options);
connection.Received().GetAll<IssueEvent>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/issues/42/events"), null, "application/vnd.github.starfox-preview+json", options);
}

[Fact]
Expand All @@ -73,7 +73,7 @@ public async Task RequestsCorrectUrlWithRepositoryIdWithApiOptions()

await client.GetAllForIssue(1, 42, options);

connection.Received().GetAll<IssueEvent>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/issues/42/events"), null, "application/vnd.github.starfox-preview", options);
connection.Received().GetAll<IssueEvent>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/issues/42/events"), null, "application/vnd.github.starfox-preview+json", options);
}

[Fact]
Expand Down Expand Up @@ -106,7 +106,7 @@ public async Task RequestsCorrectUrl()

await client.GetAllForRepository("fake", "repo");

connection.Received().GetAll<IssueEvent>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/issues/events"), null, "application/vnd.github.starfox-preview", Args.ApiOptions);
connection.Received().GetAll<IssueEvent>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/issues/events"), null, "application/vnd.github.starfox-preview+json", Args.ApiOptions);
}

[Fact]
Expand All @@ -117,7 +117,7 @@ public async Task RequestsCorrectUrlWithRepositoryId()

await client.GetAllForRepository(1);

connection.Received().GetAll<IssueEvent>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/issues/events"), null, "application/vnd.github.starfox-preview", Args.ApiOptions);
connection.Received().GetAll<IssueEvent>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/issues/events"), null, "application/vnd.github.starfox-preview+json", Args.ApiOptions);
}

[Fact]
Expand All @@ -135,7 +135,7 @@ public async Task RequestsCorrectUrlWithApiOptions()

await client.GetAllForRepository("fake", "repo", options);

connection.Received().GetAll<IssueEvent>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/issues/events"), null, "application/vnd.github.starfox-preview", options);
connection.Received().GetAll<IssueEvent>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/issues/events"), null, "application/vnd.github.starfox-preview+json", options);
}

[Fact]
Expand All @@ -153,7 +153,7 @@ public async Task RequestsCorrectUrlWithRepositoryIdWithApiOptions()

await client.GetAllForRepository(1, options);

connection.Received().GetAll<IssueEvent>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/issues/events"), null, "application/vnd.github.starfox-preview", options);
connection.Received().GetAll<IssueEvent>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/issues/events"), null, "application/vnd.github.starfox-preview+json", options);
}

[Fact]
Expand Down Expand Up @@ -186,7 +186,7 @@ public void RequestsCorrectUrl()

client.Get("fake", "repo", 42);

connection.Received().Get<IssueEvent>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/issues/events/42"), null, "application/vnd.github.starfox-preview");
connection.Received().Get<IssueEvent>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/issues/events/42"), null, "application/vnd.github.starfox-preview+json");
}

[Fact]
Expand All @@ -197,7 +197,7 @@ public void RequestsCorrectUrlWithRepositoryId()

client.Get(1, 42);

connection.Received().Get<IssueEvent>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/issues/events/42"), null, "application/vnd.github.starfox-preview");
connection.Received().Get<IssueEvent>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/issues/events/42"), null, "application/vnd.github.starfox-preview+json");
}

[Fact]
Expand All @@ -213,4 +213,4 @@ public async Task EnsuresNonNullArguments()
}
}
}
}
}
2 changes: 1 addition & 1 deletion Octokit/Helpers/AcceptHeaders.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static class AcceptHeaders

public const string ProtectedBranchesRequiredApprovingApiPreview = "application/vnd.github.luke-cage-preview+json";

public const string IssueEventsApiPreview = "application/vnd.github.starfox-preview";
public const string IssueEventsApiPreview = "application/vnd.github.starfox-preview+json";

public const string DeploymentStatusesPreview = "application/vnd.github.flash-preview+json";

Expand Down

0 comments on commit 17450fb

Please sign in to comment.