Add proxy awareness for OpenAPI spec generation

Proxy uri from command line options takes precedence over host and port
This commit is contained in:
Jacky Hu
2016-07-07 19:20:40 +08:00
parent 63046baffd
commit 1fef1991ef
12 changed files with 188 additions and 45 deletions
+6
View File
@@ -20,6 +20,7 @@ import qualified Feature.QuerySpec
import qualified Feature.RangeSpec
import qualified Feature.StructureSpec
import qualified Feature.UnicodeSpec
import qualified Feature.ProxySpec
main :: IO ()
main = do
@@ -32,6 +33,7 @@ main = do
let withApp = return $ postgrest testCfg refDbStructure pool
ltdApp = return $ postgrest testLtdRowsCfg refDbStructure pool
unicodeApp = return $ postgrest testUnicodeCfg refDbStructure pool
proxyApp = return $ postgrest testProxyCfg refDbStructure pool
hspec $ do
mapM_ (beforeAll_ resetDb . before withApp) specs
@@ -44,6 +46,10 @@ main = do
beforeAll_ resetDb . before unicodeApp $
describe "Feature.UnicodeSpec" Feature.UnicodeSpec.spec
-- this test runs with a proxy
beforeAll_ resetDb . before proxyApp $
describe "Feature.ProxySpec" Feature.ProxySpec.spec
where
specs = map (uncurry describe) [
("Feature.AuthSpec" , Feature.AuthSpec.spec)