Be sure to reset db before ALL tests

This commit is contained in:
Joe Nelson
2014-12-06 17:42:42 -08:00
parent a45718e992
commit 7d58097449
9 changed files with 11 additions and 8 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ import SpecHelper
-- }}}
spec :: Spec
spec = around withApp $
spec = before resetDb $ 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 withApp $
spec = before resetDb $ around withApp $
describe "CORS" $ do
let preflightHeaders = [
("Accept", "*/*"),
+1 -1
View File
@@ -6,7 +6,7 @@ import Test.Hspec.Wai
import SpecHelper
spec :: Spec
spec = around withApp $ do
spec = before resetDb $ 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 withApp $
spec = before resetDb $ around withApp $
describe "GET /items" $ do
context "without range headers" $
+1 -1
View File
@@ -10,7 +10,7 @@ import SpecHelper
import Network.HTTP.Types
spec :: Spec
spec = around withApp $ do
spec = before resetDb $ around withApp $ do
describe "GET /" $
it "lists views in schema" $ do
_ <- post "/dbapi/users" [json| { "id":"jdoe", "pass": "1234", "role": "dbapi_test_author" } |]
+1 -1
View File
@@ -1,4 +1,4 @@
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE QuasiQuotes, OverloadedStrings #-}
module SpecHelper where