1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Rescue spurious failures in case dummy postgresql user or schema already exists

This commit is contained in:
Jeremy Kemper 2008-09-04 17:20:07 +02:00
parent 17628ecfce
commit cd498e2588

View file

@ -18,8 +18,8 @@ class SchemaAuthorizationTest < ActiveRecord::TestCase
@connection.execute "SET search_path TO '$user',public"
set_session_auth
USERS.each do |u|
@connection.execute "CREATE USER #{u}"
@connection.execute "CREATE SCHEMA AUTHORIZATION #{u}"
@connection.execute "CREATE USER #{u}" rescue nil
@connection.execute "CREATE SCHEMA AUTHORIZATION #{u}" rescue nil
set_session_auth u
@connection.execute "CREATE TABLE #{TABLE_NAME} (#{COLUMNS.join(',')})"
@connection.execute "INSERT INTO #{TABLE_NAME} (name) VALUES ('#{u}')"