Skip to content

Commit

Permalink
add test cases for not uploading files
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharad committed Apr 30, 2024
1 parent 20203be commit 32caa36
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/Web/ScottySpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,9 @@ spec = do
(FMFile "file1.txt", "text/plain;charset=UTF-8", "file", "xxx"),
(FMFile "file1.txt", "text/plain;charset=UTF-8", "file", "xxx")
] `shouldRespondWith` 413

context "Not uploading file should return empty list (#396)" $ do
it "Length of list should be 0" $ do
postMultipartForm "/files" "ABC123" [(FMFile "", "", "", "")] `shouldRespondWith` "0"

describe "filesOpts" $ do
let
Expand All @@ -401,6 +403,10 @@ spec = do
Scotty.post "/files" processForm) $ do
it "loads uploaded files in memory" $ do
postMpForm `shouldRespondWith` 200 { matchBody = "2"}
context "Not uploading file should return empty list (#396)" $ do
withApp (Scotty.post "/files" processForm) $ do
it "Length of list should be 0" $ do
postMultipartForm "/files" "ABC123" [(FMFile "", "", "", "")] `shouldRespondWith` "0"


describe "text" $ do
Expand Down

0 comments on commit 32caa36

Please sign in to comment.