Prefixes all roles used in test suite with postgrest_test

This commit is contained in:
Diogo Biazus
2015-12-08 12:03:46 -05:00
parent 8b4cb4be6e
commit 4cc0189ac9
4 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ dbString :: String
dbString = "postgres://postgrest_test_authenticator@localhost:5432/postgrest_test"
cfg :: String -> Maybe Int -> AppConfig
cfg conStr = AppConfig conStr 3000 "postgrest_anonymous" "test" (secret "safe") 10
cfg conStr = AppConfig conStr 3000 "postgrest_test_anonymous" "test" (secret "safe") 10
cfgDefault :: AppConfig
cfgDefault = cfg dbString Nothing
+1 -1
View File
@@ -60,7 +60,7 @@ spec = around dbWithSchema $ do
quickALQuery c "select * from \"1\".items where id = ?" [snd row]
`shouldReturn` [[row]]
let {user = "jdoe"; pass = "secret"; role = "test_default_role"}
let {user = "jdoe"; pass = "secret"; role = "postgrest_test_default_role"}
describe "addUser" $ do
it "adds a correct user to the right table" $ \conn -> do
addUser user pass role conn
+3 -3
View File
@@ -2,7 +2,7 @@
GRANT USAGE ON SCHEMA
postgrest
, test
TO postgrest_anonymous;
TO postgrest_test_anonymous;
-- Schema test objects
SET search_path = test, pg_catalog;
@@ -32,12 +32,12 @@ GRANT ALL ON TABLE
, users
, users_projects
, users_tasks
TO postgrest_anonymous;
TO postgrest_test_anonymous;
GRANT USAGE ON SEQUENCE
auto_incrementing_pk_id_seq
, items_id_seq
TO postgrest_anonymous;
TO postgrest_test_anonymous;
-- Privileges for non anonymous users
GRANT USAGE ON SCHEMA test TO postgrest_test_author;
+4 -4
View File
@@ -1,7 +1,7 @@
DROP ROLE IF EXISTS postgrest_test_authenticator, postgrest_anonymous, test_default_role, postgrest_test_author;
DROP ROLE IF EXISTS postgrest_test_authenticator, postgrest_test_anonymous, postgrest_test_default_role, postgrest_test_author;
CREATE ROLE postgrest_test_authenticator WITH login;
CREATE ROLE postgrest_anonymous;
CREATE ROLE test_default_role;
CREATE ROLE postgrest_test_anonymous;
CREATE ROLE postgrest_test_default_role;
CREATE ROLE postgrest_test_author;
GRANT postgrest_anonymous, test_default_role, postgrest_test_author TO postgrest_test_authenticator;
GRANT postgrest_test_anonymous, postgrest_test_default_role, postgrest_test_author TO postgrest_test_authenticator;