Adds spec for Prefer header set to count=none

This commit is contained in:
Diogo Biazus
2015-09-24 18:31:36 -04:00
parent aee0c2c731
commit 1fbf276474
+11 -1
View File
@@ -12,11 +12,21 @@ spec = beforeAll (clearTable "items" >> createItems 15) . afterAll_ (clearTable
. around withApp $
describe "GET /items" $ do
context "without range headers" $
context "without range headers" $ do
context "with response under server size limit" $
it "returns whole range with status 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 "of acceptable range" $ do