From aee0c2c7311c0b969fd873c964d98e682fcdfbd5 Mon Sep 17 00:00:00 2001 From: Joe Nelson Date: Sun, 6 Sep 2015 17:07:00 -0700 Subject: [PATCH] Test that patch requests can set a field to null Exploring situation mentioned in #233 --- test/Feature/InsertSpec.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/Feature/InsertSpec.hs b/test/Feature/InsertSpec.hs index b8a37c167..7d19e5683 100644 --- a/test/Feature/InsertSpec.hs +++ b/test/Feature/InsertSpec.hs @@ -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"