diff --git a/test/Feature/QuerySpec.hs b/test/Feature/QuerySpec.hs index b643cbf02..50f21361b 100644 --- a/test/Feature/QuerySpec.hs +++ b/test/Feature/QuerySpec.hs @@ -296,12 +296,16 @@ spec = describe "jsonb" $ do it "can filter by properties inside json column" $ do get "/json?data->foo->>bar=eq.baz" `shouldRespondWith` - [json| [{"data": {"foo": {"bar": "baz"}}}] |] + [json| [{"data": {"id": 1, "foo": {"bar": "baz"}}}] |] get "/json?data->foo->>bar=eq.fake" `shouldRespondWith` [json| [] |] it "can filter by properties inside json column using not" $ get "/json?data->foo->>bar=not.eq.baz" `shouldRespondWith` [json| [] |] + it "can filter by properties inside json column using ->>" $ do + pendingWith "see issue #334" + get "/json?data->>id=eq.1" `shouldRespondWith` + [json| [{"data": {"id": 1, "foo": {"bar": "baz"}}}] |] describe "remote procedure call" $ do context "a proc that returns a set" . before_ (clearTable "items" >> createItems 10) . diff --git a/test/SpecHelper.hs b/test/SpecHelper.hs index f47f23b6d..f086bb0bc 100644 --- a/test/SpecHelper.hs +++ b/test/SpecHelper.hs @@ -184,4 +184,6 @@ createJsonData = do [H.stmt| insert into "1".json (data) values (?) |] - (J.object [("foo", J.object [("bar", J.String "baz")])]) + (J.object [("id", J.Number 1) + ,("foo", J.object [("bar", J.String "baz")]) + ])