From 1fbf2764745affa89e89c9d64b5da822644b04b3 Mon Sep 17 00:00:00 2001 From: Diogo Biazus Date: Thu, 24 Sep 2015 18:31:36 -0400 Subject: [PATCH] Adds spec for Prefer header set to count=none --- test/Feature/RangeSpec.hs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/Feature/RangeSpec.hs b/test/Feature/RangeSpec.hs index 311db4b37..e6c138737 100644 --- a/test/Feature/RangeSpec.hs +++ b/test/Feature/RangeSpec.hs @@ -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