Test that patch requests can set a field to null

Exploring situation mentioned in #233
This commit is contained in:
Joe Nelson
2015-09-06 17:07:00 -07:00
parent b5e76f42a5
commit aee0c2c731
+6
View File
@@ -261,6 +261,12 @@ spec = afterAll_ resetDb $ around withApp $ do
liftIO $ simpleHeaders g
`shouldSatisfy` matchHeader "Content-Range" "0-9/10"
it "can set a column to NULL" $ do
_ <- post "/no_pk" [json| { a: "keepme", b: "nullme" } |]
_ <- request methodPatch "/no_pk?b=eq.nullme" [] [json| { b: null } |]
get "/no_pk?a=eq.keepme" `shouldRespondWith`
[json| [{ a: "keepme", b: null }] |]
it "can update based on a computed column" $
request methodPatch
"/items?always_true=eq.false"