It all compiles but all requests give a postgres error
This commit is contained in:
+20
-15
@@ -3,7 +3,10 @@ module Main where
|
||||
import Test.Hspec
|
||||
import SpecHelper
|
||||
|
||||
--import PostgREST.Types (DbStructure(..))
|
||||
import Data.Pool
|
||||
import qualified Hasql.Session as H
|
||||
|
||||
import PostgREST.DbStructure (getDbStructure)
|
||||
|
||||
import qualified Feature.AuthSpec
|
||||
import qualified Feature.CorsSpec
|
||||
@@ -19,19 +22,21 @@ main = do
|
||||
setupDb
|
||||
|
||||
pool <- testPool
|
||||
dbStructure <- specDbStructure pool
|
||||
|
||||
-- Not using hspec-discover because we want to precompute
|
||||
-- the db structure and pass it to specs for speed
|
||||
hspec $ specs dbStructure pool
|
||||
withResource pool $ \case
|
||||
Left err -> error $ show err
|
||||
Right c -> do
|
||||
dbOrErr <- H.run (getDbStructure "test") c
|
||||
-- Not using hspec-discover because we want to precompute
|
||||
-- the db structure and pass it to specs for speed
|
||||
either (error.show) (hspec . specs c) dbOrErr
|
||||
|
||||
where
|
||||
specs dbStructure pool = do
|
||||
describe "Feature.AuthSpec" $ Feature.AuthSpec.spec dbStructure pool
|
||||
describe "Feature.CorsSpec" $ Feature.CorsSpec.spec dbStructure pool
|
||||
describe "Feature.DeleteSpec" $ Feature.DeleteSpec.spec dbStructure pool
|
||||
describe "Feature.InsertSpec" $ Feature.InsertSpec.spec dbStructure pool
|
||||
describe "Feature.QueryLimitedSpec" $ Feature.QueryLimitedSpec.spec dbStructure pool
|
||||
describe "Feature.QuerySpec" $ Feature.QuerySpec.spec dbStructure pool
|
||||
describe "Feature.RangeSpec" $ Feature.RangeSpec.spec dbStructure pool
|
||||
describe "Feature.StructureSpec" $ Feature.StructureSpec.spec dbStructure pool
|
||||
specs conn dbStructure = do
|
||||
describe "Feature.AuthSpec" $ Feature.AuthSpec.spec dbStructure conn
|
||||
describe "Feature.CorsSpec" $ Feature.CorsSpec.spec dbStructure conn
|
||||
describe "Feature.DeleteSpec" $ Feature.DeleteSpec.spec dbStructure conn
|
||||
describe "Feature.InsertSpec" $ Feature.InsertSpec.spec dbStructure conn
|
||||
describe "Feature.QueryLimitedSpec" $ Feature.QueryLimitedSpec.spec dbStructure conn
|
||||
describe "Feature.QuerySpec" $ Feature.QuerySpec.spec dbStructure conn
|
||||
describe "Feature.RangeSpec" $ Feature.RangeSpec.spec dbStructure conn
|
||||
describe "Feature.StructureSpec" $ Feature.StructureSpec.spec dbStructure conn
|
||||
|
||||
Reference in New Issue
Block a user