Skip to content

Commit

Permalink
chore: use AddResponse over AddError in test
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanhitt committed Dec 16, 2024
1 parent 81a7afc commit 574a0f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openapi_operations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func TestWithGlobalResponseType(t *testing.T) {
routeGlobal := Get(s, "/test-global", testController)
routeCustom := Get(s, "/test-custom", testController,
OptionAddResponse(http.StatusBadRequest, "My Local Error", Response{Type: MyLocalResponse{}}),
OptionAddError(http.StatusTeapot, "My Local Teapot", Response{Type: HTTPError{}}),
OptionAddResponse(http.StatusTeapot, "My Local Teapot", Response{Type: HTTPError{}}),
)

require.Equal(t, "My Global Error", *routeGlobal.Operation.Responses.Value("400").Value.Description, "Overrides Fuego's default 400 error")
Expand Down

0 comments on commit 574a0f9

Please sign in to comment.