diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-05 23:53:10 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-05 23:53:10 -0300 |
commit | 4fa2f10494260c0937ffe066aace09747e57d7c7 (patch) | |
tree | 614f2b74f7dbfcb940b03c9a0a56597a67d4a4cb /activerecord | |
parent | a690935804a845a22298ad7a066f8c50404952a8 (diff) | |
download | rails-4fa2f10494260c0937ffe066aace09747e57d7c7.tar.gz rails-4fa2f10494260c0937ffe066aace09747e57d7c7.tar.bz2 rails-4fa2f10494260c0937ffe066aace09747e57d7c7.zip |
Put the create_table block in a transaction.
This will solve the issue that abort the connection transaction when we
skip the tests.
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/json_test.rb | 6 |
1 files changed, 4 insertions, 2 deletions
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" |