From b02b67b4b7f67be299c1bc136cb6da0604b7a6dc Mon Sep 17 00:00:00 2001 From: "Julian K. Arni" Date: Fri, 20 Feb 2015 15:22:26 +0100 Subject: [PATCH] handleCTypeH success test --- test/Servant/API/ContentTypesSpec.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/Servant/API/ContentTypesSpec.hs b/test/Servant/API/ContentTypesSpec.hs index c90fcd29..d02203e6 100644 --- a/test/Servant/API/ContentTypesSpec.hs +++ b/test/Servant/API/ContentTypesSpec.hs @@ -125,6 +125,12 @@ spec = describe "Servant.API.ContentTypes" $ do "𝕺𝖋 π–˜π–π–”π–Šπ–˜--𝖆𝖓𝖉 π–˜π–π–Žπ–•π–˜--𝖆𝖓𝖉 π–˜π–Šπ–†π–‘π–Žπ–“π–Œ-π–œπ–†π–-- " `shouldSatisfy` isJustLeft + it "returns Just (Right val) if the decoding succeeds" $ do + let val = SomeData "Of cabbages--and kings" 12 + handleCTypeH (Proxy :: Proxy '[JSON]) "application/json" + (encode val) + `shouldBe` Just (Right val) + data SomeData = SomeData { record1 :: String, record2 :: Int } deriving (Generic, Eq, Show)