Permalink
Browse files

Add some tests to enumerate how extensions should be stored in the sc…

…hema output
  • Loading branch information...
1 parent 2f0c26b commit c0990f040f13d408786abf4a2d4ce97e7917f86c @jaggederest jaggederest committed Feb 6, 2013
@@ -35,6 +35,10 @@ def teardown
@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
@@ -231,6 +231,17 @@ def test_schema_dump_includes_decimal_options
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

0 comments on commit c0990f0

Please sign in to comment.