Add a test case for issue #334

This commit is contained in:
Pierre Radermecker
2015-10-30 19:16:59 +01:00
parent 1c22b8d429
commit 2cfe3651b4
2 changed files with 8 additions and 2 deletions
+5 -1
View File
@@ -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) .
+3 -1
View File
@@ -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")])
])