about summary refs log tree commit diff
path: root/website/sandbox/learnpianochords/src/server/Spec.hs
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-08-08T12·46+0100
committerWilliam Carroll <wpcarro@gmail.com>2020-08-08T12·46+0100
commit526728eb89963f558566b4ceb3cb95e4921c0866 (patch)
treeebdd14966f0e1047f14b602a8a52a9d97244f0b4 /website/sandbox/learnpianochords/src/server/Spec.hs
parentd34b146702476f46bcca7d362e56f46227863f1b (diff)
Test that an improperly encoded JWT returns a DecodeError
The subject of this commit message says it all.
Diffstat (limited to 'website/sandbox/learnpianochords/src/server/Spec.hs')
-rw-r--r--website/sandbox/learnpianochords/src/server/Spec.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/website/sandbox/learnpianochords/src/server/Spec.hs b/website/sandbox/learnpianochords/src/server/Spec.hs
index 6c683cbbf2..20c7b96b95 100644
--- a/website/sandbox/learnpianochords/src/server/Spec.hs
+++ b/website/sandbox/learnpianochords/src/server/Spec.hs
@@ -16,6 +16,9 @@ main = hspec $ do
   describe "GoogleSignIn" $
     describe "jwtIsValid" $ do
       let jwtIsValid' = GoogleSignIn.jwtIsValid True
+      it "returns a decode error when an incorrectly encoded JWT is used" $ do
+        jwtIsValid' (GoogleSignIn.EncodedJWT "rubbish") `shouldReturn` DecodeError
+
       it "returns validation error when the aud field doesn't match my client ID" $ do
         let auds = ["wrong-client-id"]
                    |> fmap TestUtils.unsafeStringOrURI