Merge pull request #126 from astro/master
updates for build on nixos-20.03
This commit is contained in:
commit
94b5dc497a
8 changed files with 21 additions and 16 deletions
|
@ -217,9 +217,8 @@ sendMail to subject body =
|
|||
, mailParts =[[Part
|
||||
{ partType = "text/plain; charset=utf-8"
|
||||
, partEncoding = None
|
||||
, partFilename = Nothing
|
||||
, partHeaders = []
|
||||
, partContent = E.encodeUtf8 body
|
||||
, partContent = PartContent $ E.encodeUtf8 body
|
||||
}]]
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
-- declared in the Foundation.hs file.
|
||||
module Settings where
|
||||
|
||||
import ClassyPrelude.Yesod hiding (throw)
|
||||
import ClassyPrelude.Yesod
|
||||
import Control.Exception (throw)
|
||||
import Data.Aeson (Result (..), fromJSON, withObject, (.!=),
|
||||
(.:?))
|
||||
|
|
|
@ -34,5 +34,7 @@ mkDerivation {
|
|||
persistent persistent-mysql resourcet transformers yesod yesod-core
|
||||
yesod-test
|
||||
];
|
||||
doCheck = false;
|
||||
doHaddock = false;
|
||||
license = stdenv.lib.licenses.agpl3;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ spec = withApp $ do
|
|||
request $ do
|
||||
setMethod "POST"
|
||||
setUrl HomeR
|
||||
addNonce
|
||||
addToken
|
||||
fileByLabel "Choose a file" "test/Spec.hs" "text/plain" -- talk about self-reference
|
||||
byLabel "What's on the file?" "Some Content"
|
||||
|
||||
|
|
|
@ -3,8 +3,7 @@ module Handler.SupplierActionsSpec (spec) where
|
|||
import TestImport
|
||||
|
||||
spec :: Spec
|
||||
spec = withApp $ do
|
||||
|
||||
spec =
|
||||
describe "getSupplierActionsR" $ do
|
||||
error "Spec not implemented: getSupplierActionsR"
|
||||
|
||||
xit "Spec not implemented: getSupplierActionsR" $ do
|
||||
pending
|
||||
|
|
|
@ -3,8 +3,7 @@ module Handler.SupplierSpec (spec) where
|
|||
import TestImport
|
||||
|
||||
spec :: Spec
|
||||
spec = withApp $ do
|
||||
|
||||
spec =
|
||||
describe "getSupplierR" $ do
|
||||
error "Spec not implemented: getSupplierR"
|
||||
|
||||
xit "Spec not implemented: getSupplierR" $ do
|
||||
pending
|
||||
|
|
|
@ -4,8 +4,8 @@ module TestImport
|
|||
) where
|
||||
|
||||
import Application (makeFoundation)
|
||||
import ClassyPrelude as X
|
||||
import Database.Persist as X hiding (get)
|
||||
import ClassyPrelude as X hiding (Handler)
|
||||
import Database.Persist as X hiding (get, delete, deleteBy)
|
||||
import Database.Persist.Sql (SqlPersistM, runSqlPersistMPool)
|
||||
import Foundation as X
|
||||
import Model as X
|
||||
|
@ -18,10 +18,10 @@ runDB query = do
|
|||
pool <- fmap appConnPool getTestYesod
|
||||
liftIO $ runSqlPersistMPool query pool
|
||||
|
||||
withApp :: SpecWith App -> Spec
|
||||
withApp :: SpecWith (App, a -> a) -> Spec
|
||||
withApp = before $ do
|
||||
settings <- loadAppSettings
|
||||
["config/test-settings.yml", "config/settings.yml"]
|
||||
[]
|
||||
ignoreEnv
|
||||
makeFoundation settings
|
||||
(, id) <$> makeFoundation settings
|
||||
|
|
|
@ -164,6 +164,12 @@ test-suite test
|
|||
ViewPatterns
|
||||
TupleSections
|
||||
|
||||
other-modules: Handler.CommonSpec
|
||||
Handler.HomeSpec
|
||||
Handler.SupplierActionsSpec
|
||||
Handler.SupplierSpec
|
||||
TestImport
|
||||
|
||||
build-depends: base
|
||||
, yammat
|
||||
, yesod-test >= 1.4.2
|
||||
|
|
Loading…
Reference in a new issue