Upgrade nixpkgs and add Postgres 13 support

This commit is contained in:
monacoremo
2020-10-05 13:47:53 -05:00
committed by Steve Chavez
parent d395bb6052
commit e4e84e5714
7 changed files with 45 additions and 32 deletions
+6 -2
View File
@@ -15,7 +15,7 @@ import Test.Hspec.Wai
import Test.Hspec.Wai.JSON
import Text.Heredoc
import PostgREST.Types (PgVersion, pgVersion112)
import PostgREST.Types (PgVersion, pgVersion112, pgVersion130)
import Protolude hiding (get)
import SpecHelper
@@ -152,7 +152,11 @@ spec actualPgVersion = do
it "fails with 400 and error" $
post "/simple_pk" [json| { "extra":"foo"} |]
`shouldRespondWith`
[json|{"hint":null,"details":"Failing row contains (null, foo).","code":"23502","message":"null value in column \"k\" violates not-null constraint"}|]
(if actualPgVersion >= pgVersion130 then
[json|{"hint":null,"details":"Failing row contains (null, foo).","code":"23502","message":"null value in column \"k\" of relation \"simple_pk\" violates not-null constraint"}|]
else
[json|{"hint":null,"details":"Failing row contains (null, foo).","code":"23502","message":"null value in column \"k\" violates not-null constraint"}|]
)
{ matchStatus = 400
, matchHeaders = [matchContentTypeJson]
}