[BUG] Use correct SHA in GetCommitPullRequest
- The param wasn't `sha`, it was `ref`. Use this instead. - Adds new integration tests. - Resolves #4190 - Resolves #4025
This commit is contained in:
parent
98c8d45f0b
commit
a8460bb132
2 changed files with 15 additions and 1 deletions
|
@ -749,3 +749,17 @@ func TestAPIViewRepoObjectFormat(t *testing.T) {
|
|||
DecodeJSON(t, resp, &repo)
|
||||
assert.EqualValues(t, "sha1", repo.ObjectFormatName)
|
||||
}
|
||||
|
||||
func TestAPIRepoCommitPull(t *testing.T) {
|
||||
defer tests.PrepareTestEnv(t)()
|
||||
|
||||
var pr api.PullRequest
|
||||
req := NewRequest(t, "GET", "/api/v1/repos/user2/repo1/commits/1a8823cd1a9549fde083f992f6b9b87a7ab74fb3/pull")
|
||||
resp := MakeRequest(t, req, http.StatusOK)
|
||||
|
||||
DecodeJSON(t, resp, &pr)
|
||||
assert.EqualValues(t, 1, pr.ID)
|
||||
|
||||
req = NewRequest(t, "GET", "/api/v1/repos/user2/repo1/commits/not-a-commit/pull")
|
||||
MakeRequest(t, req, http.StatusNotFound)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue