From 9a947af0e79cfb8692eb7e5ae94c1b8c40756f49 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Fri, 22 Feb 2008 03:26:21 +0000 Subject: PostgreSQL: support server versions 7.4 through 8.0 and the ruby-pg driver. Closes #11127 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8922 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/cases/defaults_test.rb | 4 +++- activerecord/test/cases/schema_authorization_test_postgresql.rb | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'activerecord/test/cases') diff --git a/activerecord/test/cases/defaults_test.rb b/activerecord/test/cases/defaults_test.rb index ac133da47a..bd19ffcc29 100644 --- a/activerecord/test/cases/defaults_test.rb +++ b/activerecord/test/cases/defaults_test.rb @@ -61,7 +61,9 @@ class DefaultTest < ActiveRecord::TestCase if current_adapter?(:PostgreSQLAdapter) def test_multiline_default_text - assert_equal "--- []\n\n", Default.columns_hash['multiline_default'].default + # older postgres versions represent the default with escapes ("\\012" for a newline) + assert ( "--- []\n\n" == Default.columns_hash['multiline_default'].default || + "--- []\\012\\012" == Default.columns_hash['multiline_default'].default) end end end diff --git a/activerecord/test/cases/schema_authorization_test_postgresql.rb b/activerecord/test/cases/schema_authorization_test_postgresql.rb index 61838d4bf7..7a0796ef53 100644 --- a/activerecord/test/cases/schema_authorization_test_postgresql.rb +++ b/activerecord/test/cases/schema_authorization_test_postgresql.rb @@ -18,7 +18,7 @@ class SchemaAuthorizationTest < ActiveRecord::TestCase @connection.execute "SET search_path TO '$user',public" set_session_auth USERS.each do |u| - @connection.execute "CREATE ROLE #{u}" + @connection.execute "CREATE USER #{u}" @connection.execute "CREATE SCHEMA AUTHORIZATION #{u}" set_session_auth u @connection.execute "CREATE TABLE #{TABLE_NAME} (#{COLUMNS.join(',')})" @@ -32,7 +32,7 @@ class SchemaAuthorizationTest < ActiveRecord::TestCase @connection.execute "RESET search_path" USERS.each do |u| @connection.execute "DROP SCHEMA #{u} CASCADE" - @connection.execute "DROP ROLE #{u}" + @connection.execute "DROP USER #{u}" end end -- cgit v1.2.3