File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -2155,3 +2155,15 @@ def test_insert_all_returns_requested_sql_fields_coerced
21552155 assert_equal %w[ REWORK ] , result . pluck ( "name" )
21562156 end
21572157end
2158+
2159+ class ActiveRecord ::Encryption ::EncryptableRecordTest < ActiveRecord ::EncryptionTestCase
2160+ # TODO: Remove coerce after Rails 7.1.0 (see https://github.com/rails/rails/pull/44052)
2161+ # Same as original but SQL Server string is varchar(4000), not varchar(255) as other adapters. Produce invalid strings with 4001 characters
2162+ coerce_tests! %r{validate column sizes}
2163+ test "validate column sizes coerced" do
2164+ assert EncryptedAuthor . new ( name : "jorge" ) . valid?
2165+ assert_not EncryptedAuthor . new ( name : "a" * 4001 ) . valid?
2166+ author = EncryptedAuthor . create ( name : "a" * 4001 )
2167+ assert_not author . valid?
2168+ end
2169+ end
You can’t perform that action at this time.
0 commit comments