Fix invalid SQL generated for bulk upsert with empty array (#1270)

This commit is contained in:
Xavier Francisco
2019-04-12 23:26:36 -05:00
committed by Steve Chávez
parent 63826e9509
commit 74e38a1d80
3 changed files with 11 additions and 2 deletions
+6
View File
@@ -44,6 +44,12 @@ spec =
, matchHeaders = ["Preference-Applied" <:> "resolution=merge-duplicates", matchContentTypeJson]
}
it "succeeds when the payload has no elements" $
request methodPost "/articles" [("Prefer", "return=representation"), ("Prefer", "resolution=merge-duplicates")]
[json|[]|] `shouldRespondWith`
[json|[]|] { matchStatus = 201 , matchHeaders = [matchContentTypeJson] }
context "when Prefer: resolution=ignore-duplicates is specified" $ do
it "INSERTs and ignores rows on pk conflict" $
request methodPost "/tiobe_pls" [("Prefer", "return=representation"), ("Prefer", "resolution=ignore-duplicates")]