Remove errReasonPhrase from servant-client test.

This commit is contained in:
aaron levin 2016-01-27 20:13:19 +01:00
parent eb7111b965
commit 0eb19f73d5

View file

@ -177,9 +177,7 @@ basicAuthHandler =
authHandler :: AuthHandler Request () authHandler :: AuthHandler Request ()
authHandler = authHandler =
let handler req = case lookup "AuthHeader" (requestHeaders req) of let handler req = case lookup "AuthHeader" (requestHeaders req) of
Nothing -> throwE (err401 { errBody = "Missing auth header" Nothing -> throwE (err401 { errBody = "Missing auth header" })
, errReasonPhrase = "denied!"
})
Just _ -> return () Just _ -> return ()
in mkAuthHandler handler in mkAuthHandler handler
@ -191,9 +189,6 @@ serverConfig = basicAuthHandler :. authHandler :. EmptyConfig
authServer :: Application authServer :: Application
authServer = serve authAPI serverConfig (const (return alice) :<|> const (return alice)) authServer = serve authAPI serverConfig (const (return alice) :<|> const (return alice))
{-
-}
{-# NOINLINE manager #-} {-# NOINLINE manager #-}
manager :: C.Manager manager :: C.Manager
manager = unsafePerformIO $ C.newManager C.defaultManagerSettings manager = unsafePerformIO $ C.newManager C.defaultManagerSettings
@ -359,7 +354,7 @@ authSpec = beforeAll (startWaiApp authServer) $ afterAll endWaiApp $ do
let (_ :<|> getProtected) = client authAPI baseUrl manager let (_ :<|> getProtected) = client authAPI baseUrl manager
let authRequest = mkAuthenticateReq () (\_ req -> SCR.addHeader "Wrong" ("header" :: String) req) let authRequest = mkAuthenticateReq () (\_ req -> SCR.addHeader "Wrong" ("header" :: String) req)
Left FailureResponse{..} <- runExceptT (getProtected authRequest) Left FailureResponse{..} <- runExceptT (getProtected authRequest)
responseStatus `shouldBe` (Status 401 "denied") responseStatus `shouldBe` (Status 401 "Unauthorized")
-- * utils -- * utils