diff options
author | Justin George <justin.george@gmail.com> | 2013-02-06 15:48:08 -0800 |
---|---|---|
committer | Justin George <justin.george@gmail.com> | 2013-02-06 16:01:25 -0800 |
commit | c0990f040f13d408786abf4a2d4ce97e7917f86c (patch) | |
tree | b6cbce03b514635f994b29f7b06d5b9108c980f4 | |
parent | 2f0c26bf5913346311b75a3b100d2f79cfe8df3c (diff) | |
download | rails-c0990f040f13d408786abf4a2d4ce97e7917f86c.tar.gz rails-c0990f040f13d408786abf4a2d4ce97e7917f86c.tar.bz2 rails-c0990f040f13d408786abf4a2d4ce97e7917f86c.zip |
Add some tests to enumerate how extensions should be stored in the schema output
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/hstore_test.rb | 4 | ||||
-rw-r--r-- | activerecord/test/cases/schema_dumper_test.rb | 11 |
2 files changed, 15 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/hstore_test.rb b/activerecord/test/cases/adapters/postgresql/hstore_test.rb index 331e3f7e4d..2b660457c4 100644 --- a/activerecord/test/cases/adapters/postgresql/hstore_test.rb +++ b/activerecord/test/cases/adapters/postgresql/hstore_test.rb @@ -35,6 +35,10 @@ class PostgresqlHstoreTest < ActiveRecord::TestCase @connection.execute 'drop table if exists hstores' end + def test_hstore_included_in_extensions + assert @connection.extensions.include?('hstore'), "extension list should include hstore" + end + def test_hstore_enabled assert @connection.extension_enabled?('hstore') end diff --git a/activerecord/test/cases/schema_dumper_test.rb b/activerecord/test/cases/schema_dumper_test.rb index cae12e0e3a..d702c0f8d1 100644 --- a/activerecord/test/cases/schema_dumper_test.rb +++ b/activerecord/test/cases/schema_dumper_test.rb @@ -231,6 +231,17 @@ class SchemaDumperTest < ActiveRecord::TestCase end if current_adapter?(:PostgreSQLAdapter) + if ActiveRecord::Base.connection.supports_extensions? + def test_schema_dump_includes_extensions + connection = ActiveRecord::Base.connection + unless connection.extension_enabled?('hstore') + connection.enable_extension 'hstore' + end + output = standard_dump + assert_match %r{enable_extension "hstore"}, output + end + end + def test_schema_dump_includes_xml_shorthand_definition output = standard_dump if %r{create_table "postgresql_xml_data_type"} =~ output |