Autolink delete http tests

This commit is contained in:
Michael Hoffman 2025-02-02 20:09:49 -05:00
parent 5fea94ed9e
commit fc5a6d1c3f
2 changed files with 73 additions and 5 deletions

View file

@ -28,7 +28,7 @@ func TestAutolinkViewer_View(t *testing.T) {
{
name: "200 successful alphanumeric view",
id: "123",
stubStatus: 200,
stubStatus: http.StatusOK,
stubRespJSON: `{
"id": 123,
"key_prefix": "TICKET-",
@ -45,7 +45,7 @@ func TestAutolinkViewer_View(t *testing.T) {
{
name: "200 successful numeric view",
id: "123",
stubStatus: 200,
stubStatus: http.StatusOK,
stubRespJSON: `{
"id": 123,
"key_prefix": "TICKET-",
@ -62,7 +62,7 @@ func TestAutolinkViewer_View(t *testing.T) {
{
name: "404 repo or autolink not found",
id: "123",
stubStatus: 404,
stubStatus: http.StatusNotFound,
stubRespJSON: `{
"message": "Not Found",
"documentation_url": "https://docs.github.com/rest/repos/autolinks#get-an-autolink-reference-of-a-repository",
@ -85,11 +85,11 @@ func TestAutolinkViewer_View(t *testing.T) {
)
defer reg.Verify(t)
autolinkCreator := &AutolinkViewer{
autolinkViewer := &AutolinkViewer{
HTTPClient: &http.Client{Transport: reg},
}
autolink, err := autolinkCreator.View(repo, tt.id)
autolink, err := autolinkViewer.View(repo, tt.id)
if tt.expectErr {
require.EqualError(t, err, tt.expectedErrMsg)