Prevent duplicate call to stored procs

Reuse a CTE for results of call
This commit is contained in:
Joe Nelson
2016-03-12 18:28:36 -08:00
parent 358254639a
commit 4cc08a11e7
5 changed files with 31 additions and 7 deletions
+6
View File
@@ -422,6 +422,12 @@ spec = do
it "GET with 405 on known procs" $
get "/rpc/sayhello" `shouldRespondWith` 405
it "executes the proc exactly once per request" $ do
post "/rpc/callcounter" [json| {} |] `shouldRespondWith`
[json| [{"callcounter":1}] |]
post "/rpc/callcounter" [json| {} |] `shouldRespondWith`
[json| [{"callcounter":2}] |]
describe "weird requests" $ do
it "can query as normal" $ do
get "/Escap3e;" `shouldRespondWith`