Skip to content

Commit 57358e1

Browse files
committed
[Rails5] Coerce a few tests with no change due to ambigious datetime nsec quoting.
1 parent 9914ef1 commit 57358e1

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/cases/coerced_tests.rb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,28 @@ def test_take_and_first_and_last_with_integer_should_use_sql_limit_coerced
381381

382382
# This fails only when run in the full test suite task. Just taking it out of the mix.
383383
coerce_tests! :test_find_with_order_on_included_associations_with_construct_finder_sql_for_association_limiting_and_is_distinct
384+
385+
# Can not use array condition due to not finding right type and hence fractional second quoting.
386+
coerce_tests! :test_condition_utc_time_interpolation_with_default_timezone_local
387+
def test_condition_utc_time_interpolation_with_default_timezone_local_coerced
388+
with_env_tz 'America/New_York' do
389+
with_timezone_config default: :local do
390+
topic = Topic.first
391+
assert_equal topic, Topic.where(written_on: topic.written_on.getutc).first
392+
end
393+
end
394+
end
395+
396+
# Can not use array condition due to not finding right type and hence fractional second quoting.
397+
coerce_tests! :test_condition_local_time_interpolation_with_default_timezone_utc
398+
def test_condition_local_time_interpolation_with_default_timezone_utc_coerced
399+
with_env_tz 'America/New_York' do
400+
with_timezone_config default: :utc do
401+
topic = Topic.first
402+
assert_equal topic, Topic.where(written_on: topic.written_on.getlocal).first
403+
end
404+
end
405+
end
384406
end
385407

386408

0 commit comments

Comments
 (0)