summaryrefslogtreecommitdiff
path: root/lambda-calcul/haskell/test/Minilang/ServerSpec.hs
blob: 309ded8aa73ba2e7efd9b99b24855dac0e442f99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module Minilang.ServerSpec where

import Minilang.Server (serveAPI)
import Network.Wai (Application)
import Test.Hspec (Spec, it)
import Test.Hspec.Wai (get, shouldRespondWith, with)

spec :: Spec
spec = with app $
  it "GET /api/leaderboard returns empty list of scores" $ do
    get "/api/leaderboard"
      `shouldRespondWith` "[]"

app :: IO Application
app = pure serveAPI