Skip to content

Commit

Permalink
try to fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
kostmo committed May 21, 2024
1 parent 54f9019 commit a0e2718
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test/tournament-host/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,21 @@ uploadForm appData urlPath form =
reqLogin <- parseRequest $ baseUrl ++ "/api/private/login/local"
respLogin <- httpLbs reqLogin manager

req <- parseRequest $ baseUrl ++ urlPath
let apiUrl = baseUrl ++ urlPath
req <- parseRequest apiUrl
resp <-
flip httpLbs manager
=<< formDataBody form (req {cookieJar = Just $ responseCookieJar respLogin})

assertEqual "Server response should be 200" ok200 $ responseStatus resp
let assertionMsg = unwords [
"Server response from"
, apiUrl
, "should be 200;"
, "'respLogin' was:"
, show respLogin
, "and 'resp' was:"
, show resp
]
assertEqual assertionMsg ok200 $ responseStatus resp
where
tournamentApp = Tournament.app appData

0 comments on commit a0e2718

Please sign in to comment.