test: server timing on root and options method
This commit is contained in:
committed by
Steve Chavez
parent
558e9d40e8
commit
b080f59bac
@@ -14,7 +14,7 @@ spec :: SpecWith ((), Application)
|
|||||||
spec =
|
spec =
|
||||||
describe "Show Duration on Server-Timing header" $ do
|
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
|
it "works with get request" $ do
|
||||||
request methodGet "/organizations?id=eq.6"
|
request methodGet "/organizations?id=eq.6"
|
||||||
[]
|
[]
|
||||||
@@ -73,3 +73,39 @@ spec =
|
|||||||
{ matchStatus = 200
|
{ matchStatus = 200
|
||||||
, matchHeaders = map matchServerTimingHasTiming ["jwt", "parse", "plan", "transaction", "response"]
|
, 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"]
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user