@@ -252,21 +252,39 @@ spec =
252252 [json |[{"id": 7, "entities":null}, {"id": 8, "entities": {"id": 2}}, {"id": 9, "entities": {"id": 3}}]|]
253253 { matchStatus = 201 }
254254
255- context " used with PATCH" $
255+ context " used with PATCH" $ do
256256 it " succeeds when using and/or params" $
257257 request methodPatch " /grandchild_entities?or=(id.eq.1,id.eq.2)&select=id,name"
258258 [(" Prefer" , " return=representation" )]
259259 [json |{ name : "updated grandchild entity"}|] `shouldRespondWith`
260260 [json |[{ "id": 1, "name" : "updated grandchild entity"},{ "id": 2, "name" : "updated grandchild entity"}]|]
261261 { matchHeaders = [matchContentTypeJson] }
262+ it " succeeds when the filtered column is modified" $
263+ request methodPatch " /entities?select=id,name&or=(name.is.null,name.like.*test*)"
264+ [(" Prefer" , " return=representation" )]
265+ [json |{ "name" : "updated entity" }|] `shouldRespondWith`
266+ [json |[{ "id": 4, "name": "updated entity" }]|]
267+ { matchHeaders = [matchContentTypeJson] }
268+ it " succeeds when the filtered column is not selected in the returned representation" $
269+ request methodPatch " /entities?select=id&or=(name.is.null,name.like.*test*)"
270+ [(" Prefer" , " return=representation" )]
271+ [json |{ "name" : "updated entity" }|] `shouldRespondWith`
272+ [json |[{ "id": 4 }]|]
273+ { matchHeaders = [matchContentTypeJson] }
262274
263- context " used with DELETE" $
275+ context " used with DELETE" $ do
264276 it " succeeds when using and/or params" $
265277 request methodDelete " /grandchild_entities?or=(id.eq.1,id.eq.2)&select=id,name"
266278 [(" Prefer" , " return=representation" )]
267279 " "
268280 `shouldRespondWith`
269281 [json |[{ "id": 1, "name" : "grandchild entity 1" },{ "id": 2, "name" : "grandchild entity 2" }]|]
282+ it " succeeds when the filtered column is not selected in the returned representation" $
283+ request methodDelete " /entities?select=id&or=(name.is.null,name.like.*test*)"
284+ [(" Prefer" , " return=representation" )]
285+ " "
286+ `shouldRespondWith`
287+ [json |[{ "id": 4 }]|]
270288
271289 it " can query columns that begin with and/or reserved words" $
272290 get " /grandchild_entities?or=(and_starting_col.eq.smth, or_starting_col.eq.smth)" `shouldRespondWith` 200
0 commit comments