diff options
Diffstat (limited to 'server/test')
-rw-r--r-- | server/test/Thermoprint/ServerSpec.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/server/test/Thermoprint/ServerSpec.hs b/server/test/Thermoprint/ServerSpec.hs index 8af210d..334f785 100644 --- a/server/test/Thermoprint/ServerSpec.hs +++ b/server/test/Thermoprint/ServerSpec.hs | |||
@@ -42,6 +42,7 @@ import System.IO.Temp | |||
42 | import qualified Data.Text as T | 42 | import qualified Data.Text as T |
43 | 43 | ||
44 | import Network.Wai.Handler.Warp (defaultSettings, setBeforeMainLoop) | 44 | import Network.Wai.Handler.Warp (defaultSettings, setBeforeMainLoop) |
45 | import Network.HTTP.Types.Status (Status(..)) | ||
45 | 46 | ||
46 | import qualified Data.Map as Map | 47 | import qualified Data.Map as Map |
47 | 48 | ||
@@ -153,7 +154,11 @@ spec = withSetup $ do | |||
153 | (atomically . takeTMVar $ outputChan printer) `shouldReturn` p | 154 | (atomically . takeTMVar $ outputChan printer) `shouldReturn` p |
154 | draftDelete dId | 155 | draftDelete dId |
155 | drafts `shouldReturn` [] | 156 | drafts `shouldReturn` [] |
157 | draftReplace dId Nothing p `shouldThrow` is404 | ||
156 | where | 158 | where |
157 | Client{..} = mkClient' $ BaseUrl Http "localhost" 3000 "" | 159 | Client{..} = mkClient' $ BaseUrl Http "localhost" 3000 "" |
160 | is404 :: ServantError -> Bool | ||
161 | is404 e@(FailureResponse {}) = statusCode (responseStatus e) == 404 | ||
162 | is404 _ = False | ||
158 | 163 | ||
159 | 164 | ||