Adds spec for Prefer header set to count=none
This commit is contained in:
@@ -12,11 +12,21 @@ spec = beforeAll (clearTable "items" >> createItems 15) . afterAll_ (clearTable
|
|||||||
. around withApp $
|
. around withApp $
|
||||||
describe "GET /items" $ do
|
describe "GET /items" $ do
|
||||||
|
|
||||||
context "without range headers" $
|
context "without range headers" $ do
|
||||||
context "with response under server size limit" $
|
context "with response under server size limit" $
|
||||||
it "returns whole range with status 200" $
|
it "returns whole range with status 200" $
|
||||||
get "/items" `shouldRespondWith` 200
|
get "/items" `shouldRespondWith` 200
|
||||||
|
|
||||||
|
context "when I don't want the count" $
|
||||||
|
it "returns range Content-Range with /*" $
|
||||||
|
request methodGet "/menagerie"
|
||||||
|
[("Prefer", "count=none")] ""
|
||||||
|
`shouldRespondWith` ResponseMatcher {
|
||||||
|
matchBody = Just "[]"
|
||||||
|
, matchStatus = 200
|
||||||
|
, matchHeaders = ["Content-Range" <:> "*/*"]
|
||||||
|
}
|
||||||
|
|
||||||
context "with range headers" $ do
|
context "with range headers" $ do
|
||||||
|
|
||||||
context "of acceptable range" $ do
|
context "of acceptable range" $ do
|
||||||
|
|||||||
Reference in New Issue
Block a user