Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
amitaibu committed Oct 6, 2024
1 parent 35af26f commit 8ecb835
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Test/FileStorage/ControllerFunctionsSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,15 @@ tests = describe "IHP.FileStorage.ControllerFunctions" $ do
, fileContent = "Hello, world!"
}

result <- storeFile fileInfo "Test.FileStorage.ControllerFunctionsSpec"
-- We pass the UUID that will be used as the filename, so we can easily assert the objectPath.
let options :: StoreFileOptions = def
{ fileName = Just "4c55dac2-e411-45ac-aa10-b957b01221df"
, directory = "Test.FileStorage.ControllerFunctionsSpec"
}

result <- storeFileWithOptions fileInfo options

result.url `shouldBe` "Test.FileStorage.ControllerFunctionsSpec/test.txt"
result.url `shouldBe` ("Test.FileStorage.ControllerFunctionsSpec/4c55dac2-e411-45ac-aa10-b957b01221df")

describe "createTemporaryDownloadUrlFromPath" $ do
it "returns baseUrl concatenated with objectPath when objectPath does not start with http:// or https://" $ do
Expand Down

0 comments on commit 8ecb835

Please sign in to comment.