From 66fd3c8c76f38072e1e0d2b34bfc7aac653c9700 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 11 Jan 2020 22:49:03 +0100 Subject: [PATCH] chore: fix tests --- .gitlab-ci.yml | 2 +- src/Settings/WellKnownFiles.hs | 2 +- test/FoundationSpec.hs | 5 +++++ test/Handler/CommonSpec.hs | 6 +++--- test/TestImport.hs | 1 + 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fa414baa8..b6e358687 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -57,8 +57,8 @@ frontend:build: artifacts: paths: - static + - well-known - config/webpack.yml - - config/favicon.json name: "${CI_JOB_NAME}" expire_in: "1 day" dependencies: diff --git a/src/Settings/WellKnownFiles.hs b/src/Settings/WellKnownFiles.hs index 2e6d416a2..91b4dfd9a 100644 --- a/src/Settings/WellKnownFiles.hs +++ b/src/Settings/WellKnownFiles.hs @@ -1,5 +1,5 @@ module Settings.WellKnownFiles - ( WellKnownFileName + ( WellKnownFileName(..) , getWellKnownR , wellKnownHtmlLinks ) where diff --git a/test/FoundationSpec.hs b/test/FoundationSpec.hs index d995cee9e..eddebfdfb 100644 --- a/test/FoundationSpec.hs +++ b/test/FoundationSpec.hs @@ -24,6 +24,11 @@ instance Arbitrary (Route EmbeddedStatic) where paramNum <- getNonNegative <$> arbitrary params <- replicateM paramNum $ (,) <$> printableText' <*> printableText return $ embeddedResourceR path params + + +instance Arbitrary WellKnownFileName where + arbitrary = genericArbitrary + shrink = genericShrink instance Arbitrary SchoolR where arbitrary = genericArbitrary diff --git a/test/Handler/CommonSpec.hs b/test/Handler/CommonSpec.hs index e1920fb6f..8e63b9d1b 100644 --- a/test/Handler/CommonSpec.hs +++ b/test/Handler/CommonSpec.hs @@ -6,12 +6,12 @@ spec :: Spec spec = withApp $ do describe "robots.txt" $ do it "gives a 200" $ do - get RobotsR + get $ WellKnownR RobotsTxt statusIs 200 it "has correct User-agent" $ do - get RobotsR + get $ WellKnownR RobotsTxt bodyContains "User-agent: *" describe "favicon.ico" $ do it "gives a 200" $ do - get FaviconR + get $ WellKnownR FaviconIco statusIs 200 diff --git a/test/TestImport.hs b/test/TestImport.hs index 8e71a84f6..2b13743ab 100644 --- a/test/TestImport.hs +++ b/test/TestImport.hs @@ -53,6 +53,7 @@ import Control.Monad.Catch as X hiding (Handler(..)) import Control.Monad.Trans.Resource (runResourceT) import Settings +import Settings.WellKnownFiles as X import Data.CaseInsensitive as X (CI) import qualified Data.CaseInsensitive as CI