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

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

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"