From 4fa2f10494260c0937ffe066aace09747e57d7c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 5 Sep 2012 23:53:10 -0300 Subject: Put the create_table block in a transaction. This will solve the issue that abort the connection transaction when we skip the tests. --- activerecord/test/cases/adapters/postgresql/json_test.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'activerecord') diff --git a/activerecord/test/cases/adapters/postgresql/json_test.rb b/activerecord/test/cases/adapters/postgresql/json_test.rb index 7907b93479..d64037eec0 100644 --- a/activerecord/test/cases/adapters/postgresql/json_test.rb +++ b/activerecord/test/cases/adapters/postgresql/json_test.rb @@ -12,8 +12,10 @@ class PostgresqlJSONTest < ActiveRecord::TestCase def setup @connection = ActiveRecord::Base.connection begin - @connection.create_table('json_data_type') do |t| - t.json 'payload', :default => {} + @connection.transaction do + @connection.create_table('json_data_type') do |t| + t.json 'payload', :default => {} + end end rescue ActiveRecord::StatementInvalid return skip "do not test on PG without json" -- cgit v1.2.3