This commit is contained in:
Michael Hoffman 2025-02-02 20:22:16 -05:00
parent e14d7a4428
commit dcc1efa2bd
4 changed files with 3 additions and 7 deletions

View file

@ -45,10 +45,6 @@ func (a *AutolinkCreator) Create(repo ghrepo.Interface, request AutolinkCreateRe
defer resp.Body.Close()
// if resp.StatusCode != http.StatusCreated {
// return nil, api.HandleHTTPError(resp)
// }
err = handleAutolinkCreateError(resp)
if err != nil {

View file

@ -133,7 +133,7 @@ func TestDeleteRun(t *testing.T) {
return nil
}
},
wantStdout: "Autolink 123 has key prefix TICKET-.✓ Autolink 123 deleted from OWNER/REPO\n",
wantStdout: "Autolink 123 has key prefix TICKET-.✓Autolink 123 deleted from OWNER/REPO\n",
},
{
name: "delete with confirm flag",

View file

@ -30,7 +30,7 @@ func (a *AutolinkViewer) View(repo ghrepo.Interface, id string) (*shared.Autolin
defer resp.Body.Close()
if resp.StatusCode == http.StatusNotFound {
return nil, fmt.Errorf("HTTP 404: Either no autolink with this ID exists for this repository or you are missing admin rights to the repository. (https://api.github.com/%s)", path)
return nil, fmt.Errorf("HTTP 404: Perhaps you are missing admin rights to the repository? (https://api.github.com/%s)", path)
} else if resp.StatusCode > 299 {
return nil, api.HandleHTTPError(resp)
}

View file

@ -69,7 +69,7 @@ func TestAutolinkViewer_View(t *testing.T) {
"status": "404"
}`,
expectErr: true,
expectedErrMsg: "HTTP 404: Either no autolink with this ID exists for this repository or you are missing admin rights to the repository. (https://api.github.com/repos/OWNER/REPO/autolinks/123)",
expectedErrMsg: "HTTP 404: Perhaps you are missing admin rights to the repository? (https://api.github.com/repos/OWNER/REPO/autolinks/123)",
},
}