Some of our specs failed between 0:00 and 2:00, but succeeded otherwise.
The issue had been that to_date
itself does not consider the timezone, such that we had to replace expressions like
I18n.localize @some_datetime.to_date
with
I18n.localize @some_datetime.in_time_zone(TEST_TIMEZONE).to_date
in order to have the specs succeed at any time.