b8Tests :: TestTree
b8Tests = decisionTestGroup "b8" "Authorized?"
  [ testCase "True ==> b7" $
      after' b8 resource req @?= Decision' "b7"
  , testCase "False ==> 401 Unauthorized" $
      let r = resource { isAuthorized = return $ Unauthorized "Basic realm=\"W\"" }
      in afterHdrs b8 r req @?=
        (error' unauthorized401, HashMap.singleton hWWWAuthenticate ["Basic realm=\"W\""])
  ]
b8Tests :: TestTree
b8Tests = decisionTestGroup "b8" "Authorized?"
  [ testCase "True ==> b7" $
      after' b8 resource req @?= Decision' "b7"
  , testCase "False ==> 401 Unauthorized" $
      let r = resource { isAuthorized = return $ Unauthorized "Basic realm=\"W\"" }
      in afterHdrs b8 r req @?=
        (error' unauthorized401, HashMap.singleton hWWWAuthenticate ["Basic realm=\"W\""])
  ]
b8Tests = decisionTestGroup "b8" "Authorized?"
  [ testCase "True ==> b7" $
      after' b8 resource req @?= Decision' "b7"
  , testCase "False ==> 401 Unauthorized" $
      let r = resource { isAuthorized = return $ Unauthorized "Basic realm=\"W\"" }
      in afterHdrs b8 r req @?=
        (error' unauthorized401, HashMap.singleton hWWWAuthenticate ["Basic realm=\"W\""])
  ]