Skip to content

Commit 0fac1db

Browse files
authored
Merge pull request #790 from aidanharan/cache-key-no-string-value
Rails 6: Coerce tests as SQL Server does not return string value for updated_at
2 parents 14d4619 + 6aa992d commit 0fac1db

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/cases/coerced_tests.rb

+13
Original file line numberDiff line numberDiff line change
@@ -1184,6 +1184,19 @@ class CollectionCacheKeyTest < ActiveRecord::TestCase
11841184

11851185

11861186

1187+
module ActiveRecord
1188+
class CacheKeyTest < ActiveRecord::TestCase
1189+
# Like Mysql2 and PostgreSQL, SQL Server doesn't return a string value for updated_at. In the Rails tests
1190+
# the tests are skipped if adapter is Mysql2 or PostgreSQL.
1191+
coerce_tests! %r{cache_version is the same when it comes from the DB or from the user}
1192+
coerce_tests! %r{cache_version does NOT call updated_at when value is from the database}
1193+
coerce_tests! %r{cache_version does not truncate zeros when timestamp ends in zeros}
1194+
end
1195+
end
1196+
1197+
1198+
1199+
11871200
require "models/book"
11881201
module ActiveRecord
11891202
class StatementCacheTest < ActiveRecord::TestCase

0 commit comments

Comments
 (0)