diff --git a/README.md b/README.md index 1ad9b7ac6..370ab8a82 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## Serve a RESTful API from any Postgres database -[![Build Status](https://travis-ci.org/begriffs/postrest.svg?branch=master)](https://travis-ci.org/begriffs/dbapi) +![Build Status](https://circleci.com/gh/begriffs/postgrest.png?circle-token=f723c01686abf0364de1e2eaae5aff1f68bd3ff2) ### Installation diff --git a/circle.yml b/circle.yml index 85a4f567f..fd146bd94 100644 --- a/circle.yml +++ b/circle.yml @@ -1,3 +1,6 @@ machine: + pre: + - createuser --superuser --no-password dbapi_test + - createdb -O dbapi_test -U ubuntu dbapi_test ghc: version: 7.8.3 diff --git a/dbapi.cabal b/dbapi.cabal index e3009fc98..02737d805 100644 --- a/dbapi.cabal +++ b/dbapi.cabal @@ -1,5 +1,5 @@ name: dbapi -version: 0.2.4.5 +version: 0.2.4.6 synopsis: The database is your api license: MIT license-file: LICENSE diff --git a/test/Feature/AuthSpec.hs b/test/Feature/AuthSpec.hs index 91198be1b..f2e4cf38d 100644 --- a/test/Feature/AuthSpec.hs +++ b/test/Feature/AuthSpec.hs @@ -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 diff --git a/test/Feature/CorsSpec.hs b/test/Feature/CorsSpec.hs index a08a64d9f..33c518cd5 100644 --- a/test/Feature/CorsSpec.hs +++ b/test/Feature/CorsSpec.hs @@ -12,7 +12,7 @@ import Network.HTTP.Types -- }}} spec :: Spec -spec = around withApp $ +spec = before resetDb $ around withApp $ describe "CORS" $ do let preflightHeaders = [ ("Accept", "*/*"), diff --git a/test/Feature/QuerySpec.hs b/test/Feature/QuerySpec.hs index f423486cc..1d477b3de 100644 --- a/test/Feature/QuerySpec.hs +++ b/test/Feature/QuerySpec.hs @@ -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 diff --git a/test/Feature/RangeSpec.hs b/test/Feature/RangeSpec.hs index e9909556f..dc31279da 100644 --- a/test/Feature/RangeSpec.hs +++ b/test/Feature/RangeSpec.hs @@ -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" $ diff --git a/test/Feature/StructureSpec.hs b/test/Feature/StructureSpec.hs index 17998e0e1..f27a7e046 100644 --- a/test/Feature/StructureSpec.hs +++ b/test/Feature/StructureSpec.hs @@ -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" } |] diff --git a/test/SpecHelper.hs b/test/SpecHelper.hs index 12fd93049..74eb9bfa7 100644 --- a/test/SpecHelper.hs +++ b/test/SpecHelper.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE QuasiQuotes #-} +{-# LANGUAGE QuasiQuotes, OverloadedStrings #-} module SpecHelper where