diff --git a/Octokit.Reactive/Clients/ObservablePullRequestsClient.cs b/Octokit.Reactive/Clients/ObservablePullRequestsClient.cs index e6b77d3fae..96a1bd3fa2 100644 --- a/Octokit.Reactive/Clients/ObservablePullRequestsClient.cs +++ b/Octokit.Reactive/Clients/ObservablePullRequestsClient.cs @@ -111,7 +111,7 @@ public IObservable GetAllForRepository(string owner, string name, A Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.PullRequests(owner, name), options); + return _connection.GetAndFlattenAllPages(ApiUrls.PullRequests(owner, name), null, AcceptHeaders.DraftPullRequestApiPreview, options); } /// @@ -126,7 +126,7 @@ public IObservable GetAllForRepository(long repositoryId, ApiOption { Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.PullRequests(repositoryId), options); + return _connection.GetAndFlattenAllPages(ApiUrls.PullRequests(repositoryId), null, AcceptHeaders.DraftPullRequestApiPreview, options); } /// @@ -180,7 +180,7 @@ public IObservable GetAllForRepository(string owner, string name, P Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.PullRequests(owner, name), - request.ToParametersDictionary(), options); + request.ToParametersDictionary(), AcceptHeaders.DraftPullRequestApiPreview, options); } /// @@ -198,7 +198,7 @@ public IObservable GetAllForRepository(long repositoryId, PullReque Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.PullRequests(repositoryId), - request.ToParametersDictionary(), options); + request.ToParametersDictionary(), AcceptHeaders.DraftPullRequestApiPreview, options); } /// diff --git a/Octokit.Tests/Reactive/ObservablePullRequestsClientTests.cs b/Octokit.Tests/Reactive/ObservablePullRequestsClientTests.cs index b76e89bdf2..4109c2d1ff 100644 --- a/Octokit.Tests/Reactive/ObservablePullRequestsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservablePullRequestsClientTests.cs @@ -209,11 +209,11 @@ public async Task ReturnsEveryPageOfPullRequests() } ); var gitHubClient = Substitute.For(); - gitHubClient.Connection.Get>(firstPageUrl, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(firstPageUrl, Args.EmptyDictionary, "application/vnd.github.shadow-cat-preview+json") .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); - gitHubClient.Connection.Get>(secondPageUrl, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(secondPageUrl, Args.EmptyDictionary, "application/vnd.github.shadow-cat-preview+json") .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); - gitHubClient.Connection.Get>(thirdPageUrl, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(thirdPageUrl, Args.EmptyDictionary, "application/vnd.github.shadow-cat-preview+json") .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); var client = new ObservablePullRequestsClient(gitHubClient); @@ -262,11 +262,11 @@ public async Task ReturnsEveryPageOfPullRequestsWithRepositoryId() } ); var gitHubClient = Substitute.For(); - gitHubClient.Connection.Get>(firstPageUrl, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(firstPageUrl, Args.EmptyDictionary, "application/vnd.github.shadow-cat-preview+json") .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); - gitHubClient.Connection.Get>(secondPageUrl, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(secondPageUrl, Args.EmptyDictionary, "application/vnd.github.shadow-cat-preview+json") .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); - gitHubClient.Connection.Get>(thirdPageUrl, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(thirdPageUrl, Args.EmptyDictionary, "application/vnd.github.shadow-cat-preview+json") .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); var client = new ObservablePullRequestsClient(gitHubClient); @@ -321,21 +321,21 @@ public async Task SendsAppropriateParametersMulti() && d["state"] == "open" && d["base"] == "fake_base_branch" && d["sort"] == "created" - && d["direction"] == "desc"), Arg.Any()) + && d["direction"] == "desc"), "application/vnd.github.shadow-cat-preview+json") .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); gitHubClient.Connection.Get>(secondPageUrl, Arg.Is>(d => d.Count == 5 && d["head"] == "user:ref-name" && d["state"] == "open" && d["base"] == "fake_base_branch" && d["sort"] == "created" - && d["direction"] == "desc"), null) + && d["direction"] == "desc"), "application/vnd.github.shadow-cat-preview+json") .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); gitHubClient.Connection.Get>(thirdPageUrl, Arg.Is>(d => d.Count == 5 && d["head"] == "user:ref-name" && d["state"] == "open" && d["base"] == "fake_base_branch" && d["sort"] == "created" - && d["direction"] == "desc"), null) + && d["direction"] == "desc"), "application/vnd.github.shadow-cat-preview+json") .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); var client = new ObservablePullRequestsClient(gitHubClient); @@ -390,21 +390,21 @@ public async Task SendsAppropriateParametersMultiWithRepositoryId() && d["state"] == "open" && d["base"] == "fake_base_branch" && d["sort"] == "created" - && d["direction"] == "desc"), Arg.Any()) + && d["direction"] == "desc"), "application/vnd.github.shadow-cat-preview+json") .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); gitHubClient.Connection.Get>(secondPageUrl, Arg.Is>(d => d.Count == 5 && d["head"] == "user:ref-name" && d["state"] == "open" && d["base"] == "fake_base_branch" && d["sort"] == "created" - && d["direction"] == "desc"), null) + && d["direction"] == "desc"), "application/vnd.github.shadow-cat-preview+json") .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); gitHubClient.Connection.Get>(thirdPageUrl, Arg.Is>(d => d.Count == 5 && d["head"] == "user:ref-name" && d["state"] == "open" && d["base"] == "fake_base_branch" && d["sort"] == "created" - && d["direction"] == "desc"), null) + && d["direction"] == "desc"), "application/vnd.github.shadow-cat-preview+json") .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); var client = new ObservablePullRequestsClient(gitHubClient);