Feature specs compile

This commit is contained in:
Joe Nelson
2014-12-06 17:42:20 -08:00
parent da79f6cea1
commit f6b7b42d75
9 changed files with 64 additions and 63 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -12,7 +12,7 @@ import Network.HTTP.Types
-- }}}
spec :: Spec
spec = around appWithFixture $
spec = around withApp $
describe "CORS" $ do
let preflightHeaders = [
("Accept", "*/*"),
+1 -1
View File
@@ -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"
+14 -1
View File
@@ -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
+1 -1
View File
@@ -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" $