From 8ecb835a5b69018f1dbc5f81dd8d9d8c8f890460 Mon Sep 17 00:00:00 2001 From: Amitai Burstein Date: Sun, 6 Oct 2024 21:11:40 +0300 Subject: [PATCH] Fix tests --- Test/FileStorage/ControllerFunctionsSpec.hs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Test/FileStorage/ControllerFunctionsSpec.hs b/Test/FileStorage/ControllerFunctionsSpec.hs index 1f06694e2..e85a80678 100644 --- a/Test/FileStorage/ControllerFunctionsSpec.hs +++ b/Test/FileStorage/ControllerFunctionsSpec.hs @@ -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