Feature specs compile
This commit is contained in:
@@ -11,7 +11,7 @@ import SpecHelper
|
||||
-- }}}
|
||||
|
||||
spec :: Spec
|
||||
spec = around appWithFixture $
|
||||
spec = around withApp $
|
||||
describe "authorization" $ do
|
||||
it "hides tables that anonymous does not own" $
|
||||
get "/authors_only" `shouldRespondWith` 400 -- TODO: should be 404
|
||||
|
||||
@@ -12,7 +12,7 @@ import Network.HTTP.Types
|
||||
-- }}}
|
||||
|
||||
spec :: Spec
|
||||
spec = around appWithFixture $
|
||||
spec = around withApp $
|
||||
describe "CORS" $ do
|
||||
let preflightHeaders = [
|
||||
("Accept", "*/*"),
|
||||
|
||||
@@ -20,7 +20,7 @@ import TestTypes(IncPK(..), CompoundPK(..))
|
||||
-- }}}
|
||||
|
||||
spec :: Spec
|
||||
spec = around appWithFixture $ do
|
||||
spec = around withApp $ do
|
||||
describe "Posting new record" $ do
|
||||
it "accepts disparate json types" $
|
||||
post "/menagerie"
|
||||
|
||||
@@ -5,8 +5,21 @@ import Test.Hspec.Wai
|
||||
|
||||
import SpecHelper
|
||||
|
||||
-- around :: (ActionWith a -> IO ()) -> SpecWith a -> Spec
|
||||
-- type Spec = SpecWith ()
|
||||
-- type ActionWith a = a -> IO ()
|
||||
--
|
||||
-- get :: ByteString -> WaiSession SResponse
|
||||
-- newtype WaiSession a = WaiSession {unWaiSession :: Session a}
|
||||
-- type Session = ReaderT Application (StateT ClientState IO)
|
||||
--
|
||||
-- type Application =
|
||||
-- Request -> (Response -> IO ResponseReceived) -> IO ResponseReceived
|
||||
--
|
||||
-- runApp :: Request -> (Response -> IO Postgres) -> IO Postgres
|
||||
|
||||
spec :: Spec
|
||||
spec = around appWithFixture $ do
|
||||
spec = around withApp $ do
|
||||
describe "Querying a nonexistent table" $
|
||||
it "causes a 404" $
|
||||
get "/faketable" `shouldRespondWith` 404
|
||||
|
||||
@@ -8,7 +8,7 @@ import Network.Wai.Test (SResponse(simpleHeaders,simpleStatus))
|
||||
import SpecHelper
|
||||
|
||||
spec :: Spec
|
||||
spec = around appWithFixture $
|
||||
spec = around withApp $
|
||||
describe "GET /items" $ do
|
||||
|
||||
context "without range headers" $
|
||||
|
||||
Reference in New Issue
Block a user