octokit.rb
octokit.rb copied to clipboard
Fix invalid documentation for "update_pull_request"
Attributes need to be key/value otherwise it doesn't work.
In curl format:
curl \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
https://api.github.com/repos/owner/repo/pulls/pull_number \
-d '{"title":"new title"}'
I think spec should test this interaction (with VCR for example)
I think spec should test this interaction (with VCR for example)
Do you mind elaborating on this a bit?
Do you mind elaborating on this a bit?
The spec at the moment do not check if the request has an impact. I know by moving to a more "integration test" we will also test the API itself but this should have revealed that the spec is not properly written.
It seems we already do something similar here:
https://github.com/benoittgt/octokit.rb/blob/0528971fb6b763d4fcdde39cd784f7723fdf8bc2/spec/octokit/client/pull_requests_spec.rb#L109
We could assert that we have a 200, and the updated fields in the answer.
Thanks! Are you proposing to do that as part of this PR as well? The changes described sound small enough to be included here.
Yes. I will try to make that change too. :)
Ok the issue now is invalid VCR tape.
Token should be specified and cassette regenerated.
rm -f spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_update_pull_request/updates_a_pull_request.json
bundle exe rspec spec/octokit/client/pull_requests_spec.rb
https://github.com/octokit/octokit.rb/pull/1256 would have helped.
I think the change on spec could be dismiss expect the proper syntaxe.
I will work on https://github.com/octokit/octokit.rb/pull/1256 to be able to make better specs like the one I tried to introduced here.
Edit: done on 7371ff9 (#1499) @kfcampbell it should be easier to merge. ;)
👋 Hey Friends, this pull request has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!