chore: fix tests

This commit is contained in:
Gregor Kleen 2020-01-11 22:49:03 +01:00
parent f853e1816a
commit 66fd3c8c76
5 changed files with 11 additions and 5 deletions

View File

@ -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:

View File

@ -1,5 +1,5 @@
module Settings.WellKnownFiles
( WellKnownFileName
( WellKnownFileName(..)
, getWellKnownR
, wellKnownHtmlLinks
) where

View File

@ -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

View File

@ -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

View File

@ -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