diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-02-05 17:46:53 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-02-05 17:47:50 -0200 |
commit | b713f1b3ccd27ef05783a3f4259bb114c033c57b (patch) | |
tree | 0623cee6811faf1167562348d6f117c9db8695d0 | |
parent | 655e95c8c3b7c8e127f095e338d77873d0b3f821 (diff) | |
download | rails-b713f1b3ccd27ef05783a3f4259bb114c033c57b.tar.gz rails-b713f1b3ccd27ef05783a3f4259bb114c033c57b.tar.bz2 rails-b713f1b3ccd27ef05783a3f4259bb114c033c57b.zip |
Enable hstore extensions on tests if it is not enabled and database supports it
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/hstore_test.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/hstore_test.rb b/activerecord/test/cases/adapters/postgresql/hstore_test.rb index 9498c829dc..331e3f7e4d 100644 --- a/activerecord/test/cases/adapters/postgresql/hstore_test.rb +++ b/activerecord/test/cases/adapters/postgresql/hstore_test.rb @@ -11,11 +11,18 @@ class PostgresqlHstoreTest < ActiveRecord::TestCase def setup @connection = ActiveRecord::Base.connection + + unless @connection.supports_extensions? + return skip "do not test on PG without hstore" + end + unless @connection.extension_enabled?('hstore') @connection.enable_extension 'hstore' - return skip "do not test on PG without hstore" + @connection.commit_db_transaction end + @connection.reconnect! + @connection.transaction do @connection.create_table('hstores') do |t| t.hstore 'tags', :default => '' |