File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -1441,6 +1441,26 @@ def test_named_bind_with_literal_colons_coerced
14411441end
14421442
14431443class SchemaDumperTest < ActiveRecord ::TestCase
1444+ # Use nvarchar string (N'') in assert
1445+ coerce_tests! :test_dump_schema_information_outputs_lexically_reverse_ordered_versions_regardless_of_database_order
1446+ def test_dump_schema_information_outputs_lexically_reverse_ordered_versions_regardless_of_database_order_coerced
1447+ versions = %w{ 20100101010101 20100201010101 20100301010101 }
1448+ versions . shuffle . each do |v |
1449+ @schema_migration . create_version ( v )
1450+ end
1451+
1452+ schema_info = ActiveRecord ::Base . connection . dump_schema_information
1453+ expected = <<~STR
1454+ INSERT INTO #{ ActiveRecord ::Base . connection . quote_table_name ( "schema_migrations" ) } (version) VALUES
1455+ (N'20100301010101'),
1456+ (N'20100201010101'),
1457+ (N'20100101010101');
1458+ STR
1459+ assert_equal expected . strip , schema_info
1460+ ensure
1461+ @schema_migration . delete_all_versions
1462+ end
1463+
14441464 # We have precision to 38.
14451465 coerce_tests! :test_schema_dump_keeps_large_precision_integer_columns_as_decimal
14461466 def test_schema_dump_keeps_large_precision_integer_columns_as_decimal_coerced
You can’t perform that action at this time.
0 commit comments