Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail when there's an unexpected response body #3095

Merged
merged 10 commits into from
Aug 24, 2023
Original file line number Diff line number Diff line change
@@ -771,13 +771,11 @@ class ServerBasicTests[F[_], OPTIONS, ROUTE](
}
},
testServer(
"fail when code = NoContent but there's a body",
"fail when status is 204 NoContent, but there's a body",
NonEmptyList.of(
route(endpoint.out(jsonBody[Unit]).out(statusCode(StatusCode.NoContent)).serverLogicSuccess(_ => pureResult(())))
)
) { (backend, baseUri) =>
basicRequest.get(uri"$baseUri").send(backend).map(_.code shouldBe StatusCode.InternalServerError)
}
) { (backend, baseUri) => basicRequest.get(baseUri).send(backend).map(_.code shouldBe StatusCode.InternalServerError) }
)

def throwFruits(name: String): F[String] =