Applies range headers to /rpc calls using LIMIT/OFFSET.

This commit is contained in:
Diogo Biazus
2016-02-26 14:41:27 -05:00
parent 3b23c4aa5b
commit 893b7a7126
4 changed files with 21 additions and 19 deletions
+4 -1
View File
@@ -370,7 +370,10 @@ spec = do
[json| [{"data": {"id": 1, "foo": {"bar": "baz"}}}] |]
describe "remote procedure call" $ do
context "a proc that returns a set" $
context "a proc that returns a set" $ do
it "returns paginated results" $
request methodPost "/rpc/getitemrange" (rangeHdrs (ByteRangeFromTo 0 0)) [json| { "min": 2, "max": 4 } |] `shouldRespondWith`
[json| [ {"id": 3} ] |]
it "returns proper json" $
post "/rpc/getitemrange" [json| { "min": 2, "max": 4 } |] `shouldRespondWith`
[json| [ {"id": 3}, {"id":4} ] |]