Skip to content

Commit 495ae43

Browse files
committed
[Rails51] Fix random failing test.
1 parent d0b5c34 commit 495ae43

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/cases/coerced_tests.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,14 @@ class BindParameterTest < ActiveRecord::TestCase
121121

122122

123123
class CalculationsTest < ActiveRecord::TestCase
124-
# I have no idea why 2 queries happen on windows vs 1.
125-
coerce_tests! :test_offset_is_kept if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
124+
# This fails randomly due to schema cache being lost?
125+
coerce_tests! :test_offset_is_kept
126+
def test_offset_is_kept_coerced
127+
Account.first
128+
queries = assert_sql { Account.offset(1).count }
129+
assert_equal 1, queries.length
130+
assert_match(/OFFSET/, queries.first)
131+
end
126132

127133
# Are decimal, not integer.
128134
coerce_tests! :test_should_return_decimal_average_of_integer_field

0 commit comments

Comments
 (0)