Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
amitaibu committed Oct 6, 2024
1 parent 6702d3e commit 2aa73c0
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions Test/FileStorage/ControllerFunctionsSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,19 @@ tests = describe "IHP.FileStorage.ControllerFunctions" $ do

result.url `shouldBe` "Test.FileStorage.ControllerFunctionsSpec/test.txt"

-- describe "createTemporaryDownloadUrlFromPathWithExpiredAt" $ do
-- it "returns baseUrl concatenated with objectPath when objectPath does not start with http:// or https://" $ do
-- context <- newControllerContext
-- let objectPath = "static/test.txt"
-- temporaryDownloadUrl <- createTemporaryDownloadUrlFromPathWithExpiredAt 3600 objectPath

-- temporaryDownloadUrl.url `shouldBe` "http://localhost:8000/static/test.txt"

-- it "returns '/' concatenated with objectPath when objectPath starts with 'http://' or 'https://'" $ do
-- context <- newControllerContext
-- let objectPath = "https://example.com/static/test.txt"
-- temporaryDownloadUrl <- createTemporaryDownloadUrlFromPathWithExpiredAt 3600 objectPath

-- temporaryDownloadUrl.url `shouldBe` "https://example.com/static/test.txt"
describe "createTemporaryDownloadUrlFromPathWithExpiredAt" $ do
it "returns baseUrl concatenated with objectPath when objectPath does not start with http:// or https://" $ do
context <- newControllerContext
let ?context = context
let objectPath = "static/test.txt"
temporaryDownloadUrl <- createTemporaryDownloadUrlFromPath objectPath

temporaryDownloadUrl.url `shouldBe` "http://localhost:8000/static/test.txt"

it "returns '/' concatenated with objectPath when objectPath starts with 'http://' or 'https://'" $ do
context <- newControllerContext
let ?context = context
let objectPath = "https://example.com/static/test.txt"
temporaryDownloadUrl <- createTemporaryDownloadUrlFromPath objectPath

temporaryDownloadUrl.url `shouldBe` "https://example.com/static/test.txt"

0 comments on commit 2aa73c0

Please sign in to comment.