fix: HTTP status responses for upserts
* PUT returns 201 instead of 200 when rows are inserted * POST with "Prefer: resolution=merge-duplicates" returns 200 instead of 201 when no rows are inserted
This commit is contained in:
@@ -45,11 +45,11 @@ spec =
|
||||
}
|
||||
|
||||
it "works with put request" $
|
||||
request methodPut "/tiobe_pls?name=eq.Go"
|
||||
request methodPut "/tiobe_pls?name=eq.Python"
|
||||
[("Prefer", "return=representation")]
|
||||
[json| [ { "name": "Go", "rank": 19 } ]|]
|
||||
[json| [ { "name": "Python", "rank": 19 } ]|]
|
||||
`shouldRespondWith`
|
||||
[json| [ { "name": "Go", "rank": 19 } ]|]
|
||||
[json| [ { "name": "Python", "rank": 19 } ]|]
|
||||
{ matchStatus = 200
|
||||
, matchHeaders = map matchServerTimingHasTiming ["jwt", "plan", "query", "render"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user