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: artifacts:
paths: paths:
- static - static
- well-known
- config/webpack.yml - config/webpack.yml
- config/favicon.json
name: "${CI_JOB_NAME}" name: "${CI_JOB_NAME}"
expire_in: "1 day" expire_in: "1 day"
dependencies: dependencies:

View File

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

View File

@ -25,6 +25,11 @@ instance Arbitrary (Route EmbeddedStatic) where
params <- replicateM paramNum $ (,) <$> printableText' <*> printableText params <- replicateM paramNum $ (,) <$> printableText' <*> printableText
return $ embeddedResourceR path params return $ embeddedResourceR path params
instance Arbitrary WellKnownFileName where
arbitrary = genericArbitrary
shrink = genericShrink
instance Arbitrary SchoolR where instance Arbitrary SchoolR where
arbitrary = genericArbitrary arbitrary = genericArbitrary
shrink = genericShrink shrink = genericShrink

View File

@ -6,12 +6,12 @@ spec :: Spec
spec = withApp $ do spec = withApp $ do
describe "robots.txt" $ do describe "robots.txt" $ do
it "gives a 200" $ do it "gives a 200" $ do
get RobotsR get $ WellKnownR RobotsTxt
statusIs 200 statusIs 200
it "has correct User-agent" $ do it "has correct User-agent" $ do
get RobotsR get $ WellKnownR RobotsTxt
bodyContains "User-agent: *" bodyContains "User-agent: *"
describe "favicon.ico" $ do describe "favicon.ico" $ do
it "gives a 200" $ do it "gives a 200" $ do
get FaviconR get $ WellKnownR FaviconIco
statusIs 200 statusIs 200

View File

@ -53,6 +53,7 @@ import Control.Monad.Catch as X hiding (Handler(..))
import Control.Monad.Trans.Resource (runResourceT) import Control.Monad.Trans.Resource (runResourceT)
import Settings import Settings
import Settings.WellKnownFiles as X
import Data.CaseInsensitive as X (CI) import Data.CaseInsensitive as X (CI)
import qualified Data.CaseInsensitive as CI import qualified Data.CaseInsensitive as CI