diff --git a/test/Feature/StructureSpec.hs b/test/Feature/StructureSpec.hs index 3d58947ac..8abe90e9c 100644 --- a/test/Feature/StructureSpec.hs +++ b/test/Feature/StructureSpec.hs @@ -13,54 +13,6 @@ import Network.Wai.Test (SResponse(simpleHeaders)) spec :: SpecWith Application spec = do - describe "GET /" $ do - it "lists views in schema" $ - request methodGet "/" [] "" - `shouldRespondWith` [json| [ - {"schema":"test","name":"Escap3e;","insertable":true} - , {"schema":"test","name":"addresses","insertable":true} - , {"schema":"test","name":"articleStars","insertable":true} - , {"schema":"test","name":"articles","insertable":true} - , {"schema":"test","name":"auto_incrementing_pk","insertable":true} - , {"schema":"test","name":"clients","insertable":true} - , {"schema":"test","name":"comments","insertable":true} - , {"schema":"test","name":"complex_items","insertable":true} - , {"schema":"test","name":"compound_pk","insertable":true} - , {"schema":"test","name":"empty_table","insertable":true} - , {"schema":"test","name":"filtered_tasks","insertable":true} - , {"schema":"test","name":"ghostBusters","insertable":true} - , {"schema":"test","name":"has_count_column","insertable":false} - , {"schema":"test","name":"has_fk","insertable":true} - , {"schema":"test","name":"insertable_view_with_join","insertable":true} - , {"schema":"test","name":"insertonly","insertable":true} - , {"schema":"test","name":"items","insertable":true} - , {"schema":"test","name":"json","insertable":true} - , {"schema":"test","name":"materialized_view","insertable":false} - , {"schema":"test","name":"menagerie","insertable":true} - , {"schema":"test","name":"no_pk","insertable":true} - , {"schema":"test","name":"nullable_integer","insertable":true} - , {"schema":"test","name":"orders","insertable":true} - , {"schema":"test","name":"projects","insertable":true} - , {"schema":"test","name":"projects_view","insertable":true} - , {"schema":"test","name":"simple_pk","insertable":true} - , {"schema":"test","name":"tasks","insertable":true} - , {"schema":"test","name":"tsearch","insertable":true} - , {"schema":"test","name":"users","insertable":true} - , {"schema":"test","name":"users_projects","insertable":true} - , {"schema":"test","name":"users_tasks","insertable":true} - , {"schema":"test","name":"withUnique","insertable":true} - ] |] - {matchStatus = 200} - - it "lists only views user has permission to see" $ do - let auth = authHeaderJWT "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoicG9zdGdyZXN0X3Rlc3RfYXV0aG9yIiwiaWQiOiJqZG9lIn0.y4vZuu1dDdwAl0-S00MCRWRYMlJ5YAMSir6Es6WtWx0" - - request methodGet "/" [auth] "" - `shouldRespondWith` [json| [ - {"schema":"test","name":"authors_only","insertable":true} - ] |] - {matchStatus = 200} - describe "Table info" $ do it "The structure of complex views is correctly detected" $ request methodOptions "/filtered_tasks" [] "" `shouldRespondWith` diff --git a/test/SpecHelper.hs b/test/SpecHelper.hs index e837887fb..9e80f9e26 100644 --- a/test/SpecHelper.hs +++ b/test/SpecHelper.hs @@ -19,15 +19,15 @@ testDbConn = "postgres://postgrest_test_authenticator@localhost:5432/postgrest_t testCfg :: AppConfig testCfg = - AppConfig testDbConn "postgrest_test_anonymous" "test" 3000 (secret "safe") 10 Nothing True + AppConfig testDbConn "postgrest_test_anonymous" "test" "localhost" 3000 (secret "safe") 10 Nothing True testUnicodeCfg :: AppConfig testUnicodeCfg = - AppConfig testDbConn "postgrest_test_anonymous" "تست" 3000 (secret "safe") 10 Nothing True + AppConfig testDbConn "postgrest_test_anonymous" "تست" "localhost" 3000 (secret "safe") 10 Nothing True testLtdRowsCfg :: AppConfig testLtdRowsCfg = - AppConfig testDbConn "postgrest_test_anonymous" "test" 3000 (secret "safe") 10 (Just 2) True + AppConfig testDbConn "postgrest_test_anonymous" "test" "localhost" 3000 (secret "safe") 10 (Just 2) True setupDb :: IO () setupDb = do