Permalink
Browse files

Put the create_table block in a transaction.

This will solve the issue that abort the connection transaction when we
skip the tests.
  • Loading branch information...
1 parent a690935 commit 4fa2f10494260c0937ffe066aace09747e57d7c7 @rafaelfranca rafaelfranca committed Sep 6, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 activerecord/test/cases/adapters/postgresql/json_test.rb
@@ -12,8 +12,10 @@ class JsonDataType < ActiveRecord::Base
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"

1 comment on commit 4fa2f10

💩

Please sign in to comment.