Skip to content

Commit dda13b9

Browse files
committed
[Rails5] Coerce schema dump for unquoted default.
1 parent b689b03 commit dda13b9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/cases/coerced_tests.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,13 @@ def test_schema_dumps_partial_indices_coerced
634634
index_definition = standard_dump.split(/\n/).grep(/t.index.*company_partial_index/).first.strip
635635
assert_equal 't.index ["firm_id", "type"], name: "company_partial_index", where: "([rating]>(10))"', index_definition
636636
end
637+
638+
# We do not quote the 2.78 string default.
639+
coerce_tests! :test_schema_dump_includes_decimal_options
640+
def test_schema_dump_includes_decimal_options_coerced
641+
output = dump_all_table_schema([/^[^n]/])
642+
assert_match %r{precision: 3,[[:space:]]+scale: 2,[[:space:]]+default: 2\.78}, output
643+
end
637644
end
638645

639646
class SchemaDumperDefaultsTest < ActiveRecord::TestCase

0 commit comments

Comments
 (0)