Skip to content

Commit 4dc5234

Browse files
committed
Merge branch 'main' into remove-old-rubies-workarounds
2 parents 51d0818 + 6e287b8 commit 4dc5234

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/cases/coerced_tests.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1948,6 +1948,20 @@ class SchemaCacheTest < ActiveRecord::TestCase
19481948
# Tests fail on Windows AppVeyor CI with 'Permission denied' error when renaming file during `File.atomic_write` call.
19491949
coerce_tests! :test_yaml_dump_and_load, :test_yaml_dump_and_load_with_gzip if RbConfig::CONFIG["host_os"] =~ /mswin|mingw/
19501950

1951+
# Cast type in SQL Server is :varchar rather than Unicode :string.
1952+
coerce_tests! :test_yaml_load_8_0_dump_without_cast_type_still_get_the_right_one
1953+
def test_yaml_load_8_0_dump_without_cast_type_still_get_the_right_one
1954+
cache = load_bound_reflection(schema_dump_8_0_path)
1955+
1956+
assert_no_queries do
1957+
columns = cache.columns_hash("courses")
1958+
assert_equal 3, columns.size
1959+
cast_type = columns["name"].fetch_cast_type(@connection)
1960+
assert_not_nil cast_type, "expected cast_type to be present"
1961+
assert_equal :varchar, cast_type.type
1962+
end
1963+
end
1964+
19511965
private
19521966

19531967
# We need to give the full paths for this to work.

0 commit comments

Comments
 (0)