on master help sign in
Fix the httpbun test suite (again)
0f7692aMark Karpov
httpbun-tests/Network/HTTP/ReqSpec.hs+5−16
@@ -54,21 +54,6 @@ spec = do
54 req GET (httpbun /: "foo") NoReqBody ignoreResponse mempty
54 req GET (httpbun /: "foo") NoReqBody ignoreResponse mempty
55 `shouldThrow` selector404ByStatusCodeException
55 `shouldThrow` selector404ByStatusCodeException
56
56
57− describe "receiving user-agent header back" $
58− it "works" $ do
59− r <-
60− req
61− GET
62− (httpbun /: "user-agent")
63− NoReqBody
64− jsonResponse
65− (header "user-agent" "Req")
66− responseBody r
67− `shouldBe` object
68− ["user-agent" .= ("Req" :: Text)]
69− responseStatusCode r `shouldBe` 200
70− responseStatusMessage r `shouldBe` "OK"
71−
72 describe "receiving request headers back" $
57 describe "receiving request headers back" $
73 it "works" $ do
58 it "works" $ do
74 r <-
59 r <-
@@ -98,7 +83,11 @@ spec = do
98 "headers"
83 "headers"
99 .= object
84 .= object
100 [ "Accept-Encoding" .= ("gzip" :: Text)
85 [ "Accept-Encoding" .= ("gzip" :: Text)
101− ]
86+ ],
87+ "form" .= emptyObject,
88+ "files" .= emptyObject,
89+ "data" .= ("" :: Text),
90+ "json" .= Null
102 ]
91 ]
103 responseHeader r "Content-Type" `shouldBe` return "application/json"
92 responseHeader r "Content-Type" `shouldBe` return "application/json"
104 responseStatusCode r `shouldBe` 200
93 responseStatusCode r `shouldBe` 200