Put the create_table block in a transaction.

This will solve the issue that abort the connection transaction when we
skip the tests.
This commit is contained in:
Rafael Mendonça França 2012-09-05 23:53:10 -03:00
parent a690935804
commit 4fa2f10494
1 changed files with 4 additions and 2 deletions

View File

@ -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"