WIP: fixing compiler errors in specs
This commit is contained in:
@@ -1,19 +1,18 @@
|
||||
module Feature.AuthSpec where
|
||||
|
||||
-- {{{ Imports
|
||||
import Data.Pool
|
||||
import Test.Hspec
|
||||
import Test.Hspec.Wai
|
||||
import Test.Hspec.Wai.JSON
|
||||
import Network.HTTP.Types
|
||||
|
||||
import Hasql as H
|
||||
import Hasql.Postgres as P
|
||||
import qualified Hasql.Connection as H
|
||||
|
||||
import SpecHelper
|
||||
import PostgREST.Types (DbStructure(..))
|
||||
-- }}}
|
||||
|
||||
spec :: DbStructure -> H.Pool P.Postgres -> Spec
|
||||
spec :: DbStructure -> Pool H.Connection -> Spec
|
||||
spec struct pool = around (withApp cfgDefault struct pool)
|
||||
$ describe "authorization" $ do
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
module Feature.CorsSpec where
|
||||
|
||||
-- {{{ Imports
|
||||
import Data.Pool
|
||||
import Test.Hspec
|
||||
import Test.Hspec.Wai
|
||||
import Network.Wai.Test (SResponse(simpleHeaders, simpleBody))
|
||||
import qualified Data.ByteString.Lazy as BL
|
||||
|
||||
import Hasql as H
|
||||
import Hasql.Postgres as P
|
||||
import qualified Hasql.Connection as H
|
||||
|
||||
import SpecHelper
|
||||
import PostgREST.Types (DbStructure(..))
|
||||
@@ -15,7 +14,7 @@ import PostgREST.Types (DbStructure(..))
|
||||
import Network.HTTP.Types
|
||||
-- }}}
|
||||
|
||||
spec :: DbStructure -> H.Pool P.Postgres -> Spec
|
||||
spec :: DbStructure -> Pool H.Connection -> Spec
|
||||
spec struct pool = around (withApp cfgDefault struct pool) $ describe "CORS" $ do
|
||||
let preflightHeaders = [
|
||||
("Accept", "*/*"),
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
module Feature.DeleteSpec where
|
||||
|
||||
import Data.Pool
|
||||
import Test.Hspec
|
||||
import Test.Hspec.Wai
|
||||
import Text.Heredoc
|
||||
|
||||
import Hasql as H
|
||||
import Hasql.Postgres as P
|
||||
|
||||
import SpecHelper
|
||||
import PostgREST.Types (DbStructure(..))
|
||||
import qualified Hasql.Connection as H
|
||||
|
||||
import Network.HTTP.Types
|
||||
|
||||
spec :: DbStructure -> H.Pool P.Postgres -> Spec
|
||||
spec :: DbStructure -> Pool H.Connection -> Spec
|
||||
spec struct pool = beforeAll resetDb
|
||||
. around (withApp cfgDefault struct pool) $
|
||||
describe "Deleting" $ do
|
||||
|
||||
@@ -5,22 +5,21 @@ import Test.Hspec.Wai
|
||||
import Test.Hspec.Wai.JSON
|
||||
import Network.Wai.Test (SResponse(simpleBody,simpleHeaders,simpleStatus))
|
||||
|
||||
import Hasql as H
|
||||
import Hasql.Postgres as P
|
||||
|
||||
import SpecHelper
|
||||
import PostgREST.Types (DbStructure(..))
|
||||
|
||||
import qualified Data.Aeson as JSON
|
||||
import Data.Maybe (fromJust)
|
||||
import Data.Pool
|
||||
import Text.Heredoc
|
||||
import Network.HTTP.Types.Header
|
||||
import Network.HTTP.Types
|
||||
import Control.Monad (replicateM_)
|
||||
import qualified Hasql.Connection as H
|
||||
|
||||
import TestTypes(IncPK(..), CompoundPK(..))
|
||||
|
||||
spec :: DbStructure -> H.Pool P.Postgres -> Spec
|
||||
spec :: DbStructure -> Pool H.Connection -> Spec
|
||||
spec struct pool = beforeAll_ resetDb $ around (withApp cfgDefault struct pool) $ do
|
||||
describe "Posting new record" $ do
|
||||
context "disparate csv types" $ do
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
module Feature.QueryLimitedSpec where
|
||||
|
||||
import Data.Pool
|
||||
import Test.Hspec hiding (pendingWith)
|
||||
import Test.Hspec.Wai
|
||||
import Test.Hspec.Wai.JSON
|
||||
import Network.HTTP.Types
|
||||
import Network.Wai.Test (SResponse(simpleHeaders, simpleStatus))
|
||||
|
||||
import Hasql as H
|
||||
import Hasql.Postgres as P
|
||||
import qualified Hasql.Connection as H
|
||||
|
||||
import SpecHelper
|
||||
import PostgREST.Types (DbStructure(..))
|
||||
|
||||
spec :: DbStructure -> H.Pool P.Postgres -> Spec
|
||||
spec :: DbStructure -> Pool H.Connection -> Spec
|
||||
spec struct pool =
|
||||
beforeAll resetDb
|
||||
. around (withApp (cfgLimitRows 3) struct pool) $
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
module Feature.QuerySpec where
|
||||
|
||||
import Data.Pool
|
||||
import Test.Hspec hiding (pendingWith)
|
||||
import Test.Hspec.Wai
|
||||
import Test.Hspec.Wai.JSON
|
||||
import Network.HTTP.Types
|
||||
import Network.Wai.Test (SResponse(simpleHeaders))
|
||||
|
||||
import Hasql as H
|
||||
import Hasql.Postgres as P
|
||||
import qualified Hasql.Connection as H
|
||||
|
||||
import SpecHelper
|
||||
import PostgREST.Types (DbStructure(..))
|
||||
import Text.Heredoc
|
||||
|
||||
spec :: DbStructure -> H.Pool P.Postgres -> Spec
|
||||
spec :: DbStructure -> Pool H.Connection -> Spec
|
||||
spec struct pool = around (withApp cfgDefault struct pool) $ do
|
||||
|
||||
describe "Querying a table with a column called count" $
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
module Feature.RangeSpec where
|
||||
|
||||
import Data.Pool
|
||||
import Test.Hspec
|
||||
import Test.Hspec.Wai
|
||||
import Test.Hspec.Wai.JSON
|
||||
import Network.HTTP.Types
|
||||
import Network.Wai.Test (SResponse(simpleHeaders,simpleStatus))
|
||||
|
||||
import Hasql as H
|
||||
import Hasql.Postgres as P
|
||||
import qualified Hasql.Connection as H
|
||||
|
||||
import SpecHelper
|
||||
import PostgREST.Types (DbStructure(..))
|
||||
|
||||
spec :: DbStructure -> H.Pool P.Postgres -> Spec
|
||||
spec :: DbStructure -> Pool H.Connection -> Spec
|
||||
spec struct pool = beforeAll resetDb
|
||||
. around (withApp cfgDefault struct pool) $
|
||||
describe "GET /items" $ do
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
module Feature.StructureSpec where
|
||||
|
||||
import Data.Pool
|
||||
import Test.Hspec hiding (pendingWith)
|
||||
import Test.Hspec.Wai
|
||||
import Test.Hspec.Wai.JSON
|
||||
|
||||
import Hasql as H
|
||||
import Hasql.Postgres as P
|
||||
import qualified Hasql.Connection as H
|
||||
|
||||
import SpecHelper
|
||||
import PostgREST.Types (DbStructure(..))
|
||||
|
||||
import Network.HTTP.Types
|
||||
|
||||
spec :: DbStructure -> H.Pool P.Postgres -> Spec
|
||||
spec :: DbStructure -> Pool H.Connection -> Spec
|
||||
spec struct pool = around (withApp cfgDefault struct pool) $ do
|
||||
describe "GET /" $ do
|
||||
it "lists views in schema" $
|
||||
|
||||
Reference in New Issue
Block a user