@@ -25,7 +25,7 @@ spec = let
|
||||
it "allows partial rollback of request" $ \c -> do
|
||||
let app = withSavepoint Test dbErrApp c
|
||||
[[beforeCount]] <- quickQuery c "select count(*) from \"1\".items" []
|
||||
runRaw c "set role dbapi_anonymous"
|
||||
runRaw c "set role postgrest_anonymous"
|
||||
_ <- insert "1" "items" (SqlRow []) c
|
||||
catch (void $ app defaultRequest (const undefined) ) $
|
||||
\e -> let _ = (e::SqlError) in do
|
||||
|
||||
@@ -64,7 +64,7 @@ spec = around dbWithSchema $ do
|
||||
describe "addUser" $ do
|
||||
it "adds a correct user to the right table" $ \conn -> do
|
||||
addUser user pass role conn
|
||||
[r] <- quickQuery conn "select * from dbapi.auth" []
|
||||
[r] <- quickQuery conn "select * from postgrest.auth" []
|
||||
let [newUser, newRole, encryptedPass] = map fromSql r :: [String]
|
||||
cs newUser `shouldBe` user
|
||||
cs newRole `shouldBe` role
|
||||
|
||||
@@ -34,4 +34,4 @@ spec = around dbWithSchema $ beforeWith setRole $ do
|
||||
("auto_inc_fk", ForeignKey {fkTable="auto_incrementing_pk", fkCol="id"}),
|
||||
("simple_fk", ForeignKey { fkTable="simple_pk", fkCol="k"})]
|
||||
|
||||
where setRole conn = quickQuery conn "set role dbapi_test" [] >> return conn
|
||||
where setRole conn = quickQuery conn "set role postgrest_test" [] >> return conn
|
||||
|
||||
Reference in New Issue
Block a user