test: move db-pre-config with pg reserved word func to spec tests

Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
This commit is contained in:
Taimoor Zaeem
2026-07-07 23:32:40 +05:00
parent 6670b1a4b6
commit 44edf962d8
5 changed files with 15 additions and 37 deletions
+11 -3
View File
@@ -10,14 +10,16 @@ import Test.Hspec.Wai
import Test.Hspec.Wai.JSON
import Text.Heredoc
import PostgREST.Config.PgVersion (PgVersion, pgVersion180)
import PostgREST.Config (AppConfig (..))
import PostgREST.Config.PgVersion (PgVersion, pgVersion180)
import PostgREST.SchemaCache.Identifiers (QualifiedIdentifier (..))
import Protolude hiding (get)
import SpecHelper
spec :: PgVersion -> SpecWithConfig
spec actualPgVersion withConfig = withConfig baseCfg $
describe "remote procedure call" $ do
spec actualPgVersion withConfig = do
withConfig baseCfg $ describe "remote procedure call" $ do
context "a proc that returns a set" $ do
context "returns paginated results" $ do
it "using the Range header" $
@@ -1490,3 +1492,9 @@ spec actualPgVersion withConfig = withConfig baseCfg $
`shouldRespondWith`
[json| 1 |]
{ matchStatus = 200 }
withConfig baseCfg { configDbPreConfig = Just $ QualifiedIdentifier "test" "true" } $
it "should not fail when function name is a pg reserved word" $
request methodGet "/rpc/true"
[] ""
`shouldRespondWith` 200
+4
View File
@@ -3877,3 +3877,7 @@ create or replace function custom_vary_hdr() returns void as $$
perform set_config('response.headers', '[{"Vary": "X-Test-Accept"}]', false);
end
$$ language plpgsql;
create or replace function "true"() returns boolean as $_$
select true;
$_$ language sql;