test: move error verbosity test from io tests 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 6191243c64
commit c73c676849
2 changed files with 13 additions and 33 deletions
+13 -1
View File
@@ -5,7 +5,7 @@ import Test.Hspec
import Test.Hspec.Wai
import Test.Hspec.Wai.JSON
import PostgREST.Config (AppConfig (..))
import PostgREST.Config (AppConfig (..), Verbosity (..))
import Protolude hiding (get)
import SpecHelper
@@ -223,3 +223,15 @@ spec withConfig = do
"message":"Wrong or unsupported encoding algorithm"
}|]
{ matchStatus = 401 }
-- By default, error verbosity is set to 'verbose', which returns all error
-- fields. No need to test that explicitly.
withConfig baseCfg { configClientErrorVerbosity = Minimal } $ describe "Test client-error-verbosity config" $
it "hides details and hint when set to 'minimal'" $
request methodGet "/itemsx" [] ""
`shouldRespondWith`
[json|{
"code":"PGRST205",
"message":"Could not find the table 'test.itemsx' in the schema cache"
}|]
{ matchStatus = 404 }