perf: shortcut for proc with no variadic arg

Also refactor how rpc params are converted to json
This commit is contained in:
steve-chavez
2020-10-29 18:53:24 -05:00
committed by Steve Chavez
parent 2798ced9b9
commit 8618ffa5fc
7 changed files with 71 additions and 73 deletions
+3 -3
View File
@@ -3,7 +3,7 @@ module Feature.RpcSpec where
import qualified Data.ByteString.Lazy as BL (empty)
import Network.Wai (Application)
import Network.Wai.Test (SResponse (simpleBody, simpleStatus, simpleHeaders))
import Network.Wai.Test (SResponse (simpleBody, simpleHeaders, simpleStatus))
import Network.HTTP.Types
import Test.Hspec hiding (pendingWith)
@@ -523,8 +523,8 @@ spec actualPgVersion =
`shouldRespondWith`
[json|["hi", "there"]|]
it "returns first value for repeated params without VARIADIC" $
get "/rpc/sayhello?name=world&name=ignored"
it "returns last value for repeated params without VARIADIC" $
get "/rpc/sayhello?name=ignored&name=world"
`shouldRespondWith`
[json|"Hello, world"|]