diff --git a/Handler/Common.hs b/Handler/Common.hs index cb35dda..ce06c17 100644 --- a/Handler/Common.hs +++ b/Handler/Common.hs @@ -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 }]] } diff --git a/Settings.hs b/Settings.hs index 37f1435..22cd795 100644 --- a/Settings.hs +++ b/Settings.hs @@ -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, (.!=), (.:?)) diff --git a/default.nix b/default.nix index 119fd7d..98a7266 100644 --- a/default.nix +++ b/default.nix @@ -34,5 +34,7 @@ mkDerivation { persistent persistent-mysql resourcet transformers yesod yesod-core yesod-test ]; + doCheck = false; + doHaddock = false; license = stdenv.lib.licenses.agpl3; } diff --git a/test/Handler/HomeSpec.hs b/test/Handler/HomeSpec.hs index 2b6abbe..e0102f6 100755 --- a/test/Handler/HomeSpec.hs +++ b/test/Handler/HomeSpec.hs @@ -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" diff --git a/test/Handler/SupplierActionsSpec.hs b/test/Handler/SupplierActionsSpec.hs index 0741207..1cdd3c8 100755 --- a/test/Handler/SupplierActionsSpec.hs +++ b/test/Handler/SupplierActionsSpec.hs @@ -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 diff --git a/test/Handler/SupplierSpec.hs b/test/Handler/SupplierSpec.hs index 23f8d34..75b5ec0 100755 --- a/test/Handler/SupplierSpec.hs +++ b/test/Handler/SupplierSpec.hs @@ -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 diff --git a/test/TestImport.hs b/test/TestImport.hs index bd647a6..3f00ccb 100644 --- a/test/TestImport.hs +++ b/test/TestImport.hs @@ -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 diff --git a/yammat.cabal b/yammat.cabal index d7e74d3..2b64161 100644 --- a/yammat.cabal +++ b/yammat.cabal @@ -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