test: server timing on root and options method

This commit is contained in:
steve-chavez
2023-11-28 10:25:25 -05:00
committed by Steve Chavez
parent 558e9d40e8
commit b080f59bac
+37 -1
View File
@@ -14,7 +14,7 @@ spec :: SpecWith ((), Application)
spec =
describe "Show Duration on Server-Timing header" $ do
context "responseonds with Server-Timing header" $ do
context "responds with Server-Timing header" $ do
it "works with get request" $ do
request methodGet "/organizations?id=eq.6"
[]
@@ -73,3 +73,39 @@ spec =
{ matchStatus = 200
, matchHeaders = map matchServerTimingHasTiming ["jwt", "parse", "plan", "transaction", "response"]
}
it "works with root spec" $
request methodHead "/"
[]
""
`shouldRespondWith`
""
{ matchStatus = 200
, matchHeaders = map matchServerTimingHasTiming ["jwt", "parse", "plan", "transaction", "response"]
}
it "works with OPTIONS method" $ do
request methodOptions "/organizations"
[]
""
`shouldRespondWith`
""
{ matchStatus = 200
, matchHeaders = map matchServerTimingHasTiming ["jwt", "parse", "response"]
}
request methodOptions "/rpc/getallprojects"
[]
""
`shouldRespondWith`
""
{ matchStatus = 200
, matchHeaders = map matchServerTimingHasTiming ["jwt", "parse", "response"]
}
request methodOptions "/"
[]
""
`shouldRespondWith`
""
{ matchStatus = 200
, matchHeaders = map matchServerTimingHasTiming ["jwt", "parse", "response"]
}