From b080f59bac6cfd8ce804755b1794b51bac807072 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Tue, 28 Nov 2023 09:32:29 -0500 Subject: [PATCH] test: server timing on root and options method --- test/spec/Feature/Query/ServerTimingSpec.hs | 38 ++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/test/spec/Feature/Query/ServerTimingSpec.hs b/test/spec/Feature/Query/ServerTimingSpec.hs index de20e90b2..11cf29948 100644 --- a/test/spec/Feature/Query/ServerTimingSpec.hs +++ b/test/spec/Feature/Query/ServerTimingSpec.hs @@ -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"] + }