only create schema once
This commit is contained in:
@@ -11,8 +11,7 @@ import SpecHelper
|
||||
-- }}}
|
||||
|
||||
spec :: Spec
|
||||
spec = beforeAll resetDb $ around withApp $
|
||||
describe "authorization" $ do
|
||||
spec = around withApp $ describe "authorization" $ do
|
||||
it "hides tables that anonymous does not own" $
|
||||
get "/authors_only" `shouldRespondWith` 404
|
||||
it "indicates login failure" $ do
|
||||
|
||||
@@ -12,8 +12,7 @@ import Network.HTTP.Types
|
||||
-- }}}
|
||||
|
||||
spec :: Spec
|
||||
spec = beforeAll resetDb $ around withApp $
|
||||
describe "CORS" $ do
|
||||
spec = around withApp $ describe "CORS" $ do
|
||||
let preflightHeaders = [
|
||||
("Accept", "*/*"),
|
||||
("Origin", "http://example.com"),
|
||||
|
||||
@@ -19,7 +19,7 @@ import TestTypes(IncPK(..), CompoundPK(..))
|
||||
--import Debug.Trace
|
||||
|
||||
spec :: Spec
|
||||
spec = beforeAll resetDb $ around withApp $ do
|
||||
spec = around withApp $ do
|
||||
describe "Posting new record" $ do
|
||||
after_ (clearTable "menagerie") . it "accepts disparate json types" $ do
|
||||
p <- post "/menagerie"
|
||||
|
||||
@@ -6,10 +6,8 @@ import Test.Hspec.Wai
|
||||
import SpecHelper
|
||||
|
||||
spec :: Spec
|
||||
spec = beforeAll (do
|
||||
resetDb
|
||||
createItems 15
|
||||
) . afterAll_ (clearTable "items") . around withApp $ do
|
||||
spec = beforeAll (clearTable "items" >> createItems 15)
|
||||
. afterAll_ (clearTable "items") . 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 = beforeAll (resetDb >> createItems 15) . afterAll_ (clearTable "items")
|
||||
spec = beforeAll (clearTable "items" >> createItems 15) . afterAll_ (clearTable "items")
|
||||
. around withApp $
|
||||
describe "GET /items" $ do
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import SpecHelper
|
||||
import Network.HTTP.Types
|
||||
|
||||
spec :: Spec
|
||||
spec = beforeAll resetDb $ around withApp $ do
|
||||
spec = around withApp $ do
|
||||
describe "GET /" $ do
|
||||
it "lists views in schema" $
|
||||
request methodGet "/" [] ""
|
||||
|
||||
Reference in New Issue
Block a user