Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #180 from creekace/fixing-pull-merged-request

Update pull-merged? method to reflect GET request from Github API docs
  • Loading branch information...
commit 66b6e7eea3ccc183233bb72ac847f6a00ea45f98 2 parents de6019e + 4c9aa88
@pengwynn pengwynn authored
View
2  lib/octokit/client/pulls.rb
@@ -236,7 +236,7 @@ def merge_pull_request(repo, number, commit_message='', options={})
# @return [Boolean] True if the pull request has been merged
def pull_merged?(repo, number, options={})
begin
- get("repos/#{Repository.new(repo)}/pulls/#{number}/merged", options)
+ get("repos/#{Repository.new(repo)}/pulls/#{number}/merge", options)
return true
rescue Octokit::NotFound
return false
View
2  spec/octokit/client/pulls_spec.rb
@@ -189,7 +189,7 @@
describe ".pull_merged?" do
it "returns whether the pull request has been merged" do
- stub_get("https://api.github.com/repos/pengwynn/octokit/pulls/67/merged").
+ stub_get("https://api.github.com/repos/pengwynn/octokit/pulls/67/merge").
to_return(:status => 204)
merged = @client.pull_merged?("pengwynn/octokit", 67)
expect(merged).to be_true
Please sign in to comment.
Something went wrong with that request. Please try again.