WIP: add argument for custom pre-request handler

This commit is contained in:
Joe Nelson
2016-09-27 00:19:05 -07:00
parent 2f8ac24128
commit 06363ccc77
7 changed files with 28 additions and 9 deletions
+5
View File
@@ -103,6 +103,11 @@ spec = describe "authorization" $ do
]
}
it "runs a custom request validation proc" $ do
let auth = authHeaderJWT "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYmFkX3JvbGUifQ.ENAiheEOlskpfoT5byj-gKJkOhHKTvETQu1Zso3c4Ts"
request methodGet "/items" [auth] ""
`shouldRespondWith` 400
it "should fail when jwt contains no claims" $ do
let auth = authHeaderJWT "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30.lu-rG8aSCiw-aOlN0IxpRGz5r7Jwq7K9r3tuMPUpytI"
request methodGet "/authors_only" [auth] ""