WIP: more comprehensive test of rpc args

Breaks toks2arg
This commit is contained in:
Joe Nelson
2016-09-21 23:54:08 -07:00
parent 0314f4bdea
commit 539df21627
2 changed files with 18 additions and 3 deletions
+3 -3
View File
@@ -29,14 +29,14 @@ spec = do
it "includes a representative function with parameters" $ do
r <- simpleBody <$> get "/"
let ref = r ^? key "paths" . key "/rpc/login"
let ref = r ^? key "paths" . key "/rpc/varied_arguments"
. key "post" . key "parameters"
. nth 0 . key "schema"
. key "$ref" . _String
login = r ^? key "definitions" . key "(rpc) login"
login = r ^? key "definitions" . key "(rpc) varied_arguments"
liftIO $ do
ref `shouldBe` Just "#/definitions/(rpc) login"
ref `shouldBe` Just "#/definitions/(rpc) varied_arguments"
login `shouldBe` Just
[aesonQQ|
{
+15
View File
@@ -215,6 +215,21 @@ SELECT rolname::text, id::text FROM postgrest.auth WHERE id = id AND pass = pass
$$;
CREATE FUNCTION varied_arguments(
double double precision,
"varchar" character varying,
"boolean" boolean,
date date,
money money,
enum enum_menagerie_type,
"integer" integer default 42
) RETURNS text
LANGUAGE sql
AS $_$
SELECT 'Hi';
$_$;
--
-- Name: jwt_test(); Type: FUNCTION; Schema: test; Owner: -
--