summaryrefslogtreecommitdiff
path: root/lambda-calcul/haskell/test/Minilang
diff options
context:
space:
mode:
authorArnaud Bailly <arnaud@pankzsoft.com>2025-11-05 16:28:56 +0100
committerArnaud Bailly <arnaud@pankzsoft.com>2025-11-05 16:28:56 +0100
commitf08fa03af4f6cf38e664d74c6a0a4a3e65746fb2 (patch)
tree8c988caea702e0f2ac9be9c8b697a8a7bb0e9ed3 /lambda-calcul/haskell/test/Minilang
parentafcfa146122179dc80dd8055314b1381d152fb09 (diff)
downloadlambda-nantes-f08fa03af4f6cf38e664d74c6a0a4a3e65746fb2.tar.gz
provide help on the leaderboard and OpenAPI specification
Diffstat (limited to 'lambda-calcul/haskell/test/Minilang')
-rw-r--r--lambda-calcul/haskell/test/Minilang/ServerSpec.hs11
1 files changed, 10 insertions, 1 deletions
diff --git a/lambda-calcul/haskell/test/Minilang/ServerSpec.hs b/lambda-calcul/haskell/test/Minilang/ServerSpec.hs
index a60c232..80e9f5e 100644
--- a/lambda-calcul/haskell/test/Minilang/ServerSpec.hs
+++ b/lambda-calcul/haskell/test/Minilang/ServerSpec.hs
@@ -36,7 +36,16 @@ spec = with (app testSeed) $ do
{ matchBody = MatchBody $ \_ actual ->
if "<html>" `isInfixOf` toStrict actual
then Nothing
- else Just "Expected HTML content"
+ else Just ("Expected HTML content, got: " <> LT.unpack (decodeUtf8 actual))
+ }
+
+ it "GET /api.json returns OpenApi 2 descriptor" $ do
+ get "/api.json"
+ `shouldRespondWith` 200
+ { matchBody = MatchBody $ \_ actual ->
+ if "\"swagger\":\"2.0\"" `isInfixOf` toStrict actual
+ then Nothing
+ else Just ("Expected JSON OpenApi descriptor, got: " <> LT.unpack (decodeUtf8 actual))
}
it "GET /api/leaderboard returns empty list of scores at start" $ do