[Regression] Rails/FreezeTime
gives invalid suggestion when travel_to is passed a Ruby expression
#848
Labels
bug
Something isn't working
This looks like a partial regression of #769
It happens when the arguments passed to
travel_to
is a Ruby expression more complex than simply aTime
/Date
instantiation.Time.new(2019, 4, 3, 12, 30).in_time_zone
triggers the bugTime.new(2019, 4, 3, 12, 30)
doesn't trigger the bugis not valid syntaxTime.new.in_time_zone(2019, 4, 3, 12, 30)
doesn't trigger the bugExpected behaviour
RuboCop Rails should not have suggested to replace
travel_to a_ruby_expression
withfreeze_time
Actual behavior
RuboCop Rails suggested to autocorrect a
travel_to
with a ruby expression withfreeze_time
Steps to reproduce the problem
In a Rails 7 project, add the following code to a file
spec/rails_time_freeze_spec.rb
Run
bin/rubocop spec/rails_time_freeze_spec.rb
Output is
RuboCop version
The text was updated successfully, but these errors were encountered: