handle proper version info parsing

This commit is contained in:
Lucy Cifferello
2020-06-08 15:18:57 -06:00
parent 138011f392
commit db59e3b7ed
8 changed files with 102 additions and 48 deletions

View File

@@ -6,11 +6,24 @@ import Startlude
import TestImport
spec :: Spec
spec = describe "GET /apps" $
spec = do
describe "GET /apps" $
withApp $ it "returns list of apps" $ do
request $ do
setMethod "GET"
setUrl ("/apps" :: Text)
bodyContains "bitcoind"
bodyContains "version: 0.18.1"
statusIs 200
describe "GET /apps/:appId" $
withApp $ it "fails to get unknown app" $ do
request $ do
setMethod "GET"
setUrl ("/apps/bitcoind.s9pk?spec=0.18.2" :: Text)
statusIs 404
describe "GET /apps/:appId" $
withApp $ it "makes da records" $ do
request $ do
setMethod "GET"
setUrl ("/apps/bitcoind.s9pk?spec=0.18.1" :: Text)
statusIs 200