提交 c0990f04 编写于 作者: J Justin George

Add some tests to enumerate how extensions should be stored in the schema output

上级 2f0c26bf
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册