fix: Prefer: missing=default with DOMAIN defaults

This commit is contained in:
steve-chavez
2023-06-30 17:46:16 -05:00
committed by Steve Chavez
parent 0a1564ba5a
commit a17dd41d6b
4 changed files with 29 additions and 6 deletions
+9
View File
@@ -529,6 +529,15 @@ spec actualPgVersion = do
}|])
{ matchStatus = 400 }
it "inserts a default on a DOMAIN with default" $
request methodPost "/evil_friends?columns=id,name" [("Prefer", "return=representation"), ("Prefer", "missing=default")]
[json| { "name": "Lu" } |]
`shouldRespondWith`
[json| [{"id": 666, "name": "Lu"}] |]
{ matchStatus = 201
, matchHeaders = ["Preference-Applied" <:> "missing=default"]
}
it "inserts json that has duplicate keys" $ do
request methodPost "/tbl_w_json" [("Prefer", "return=representation")]
[json| { "data": { "a": 1, "a": 2 }, "id": 3 } |]