chore: fix tests
This commit is contained in:
parent
f853e1816a
commit
66fd3c8c76
@ -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:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
module Settings.WellKnownFiles
|
module Settings.WellKnownFiles
|
||||||
( WellKnownFileName
|
( WellKnownFileName(..)
|
||||||
, getWellKnownR
|
, getWellKnownR
|
||||||
, wellKnownHtmlLinks
|
, wellKnownHtmlLinks
|
||||||
) where
|
) where
|
||||||
|
|||||||
@ -24,6 +24,11 @@ instance Arbitrary (Route EmbeddedStatic) where
|
|||||||
paramNum <- getNonNegative <$> arbitrary
|
paramNum <- getNonNegative <$> arbitrary
|
||||||
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
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user